When we run into errors that aren't just assertion failures we should just be able to look at the entire call stack.
M7QK5UKUYRA7WW4C5FAUV3WOKNVGSRFB4WKPIRPVZLNB32FIZ77QC
AYIW5JZNVNMZI6U7Y44VLEQEU36PPXHINSERMLGDBR3TFOVROW3AC
EEBBAGBBT5FRYVZXWY53OJIYSKFMNWD6TX56RRNW3ACUCTQUDRMAC
U2AANUIQU75UV4FVNPQDAI5VBWEOFSNRUR2EOQZP2EACT3ZUVKXQC
3QNOKBFMKBGXBVJIRHR2444JRRMBTABHE4674NR3DT67RRM2X6GAC
DBPKNKLVQ6KGZLBGRMY6D6ZS3G7K3I5O6UU6EHHBFGR24NXPNZYAC
QZDCEIJQUFLOLBITHHCJWVGYCZZPIBVSZDRSAGRK2V2GUNJPLF5AC
F3JDOBJZBD3UI7ME6XPJZYHCKGQRITNTNLKRGIYXUJRWZCBGGCTAC
ORRSP7FVCHI2TF5GXBRGQYYJAA3JFYXZBM3T663BKSBV22FCZVCAC
3SEFLYPZ5FIQBPMKC2SLLWQSHGGN3FKX63YM5XUYFJVDH7Z3E4ZQC
HMZSOZQCBEQBHYDEZ57U4LAITX4XHFMASJDJOB2WZHYAD53QEKCAC
end
-- Test_errors will be an array
-- add test_name and guess at file/line
function record_error_with_heuristic_location(test_name, err)
local err_without_line_number = err:gsub('^[^:]*:[^:]*: ', '')
local stack_trace = debug.traceback('', --[[stack frame]]5)
local file_and_line_number = stack_trace:gsub('stack traceback:\n', ''):gsub(': .*', '') --[[strip newline and tab]] :sub(3)
local full_error = test_name..' -- '..err_without_line_number..' ('..file_and_line_number..')'
table.insert(Test_errors, full_error)