When we run into errors that aren't just assertion failures we should just be able to look at the entire call stack.
A3Z3S62K7DVN5F4J46A6A4FE6AMBBCGT2A44L6F34GSTM5EFOTBAC
FHRFVEJVBHYI2Y6DX2ATBUQSOPW5GHQT4SYGXW4PA7SN2TCABL6QC
2NTKHMLG75XXFYYMIBH4GJBEJVEEUT4INKUAFLE6YWFJ52JVAJQAC
ARYMNK524OVUNQDFD7PO4CVRCFMPL7CLWXMTVRMSJSTUTRP4KCXQC
3QNOKBFMKBGXBVJIRHR2444JRRMBTABHE4674NR3DT67RRM2X6GAC
JNJ4R56X3HVU4IGKZZ2IV73PALEXSYOIOAIVXZTV43BG7PEY6AOQC
5ZCQGZP5VK6RIXOFQ7L4OGXFRRBPWWJNQYTWVUKJRCO7UTBPA3IAC
3QMTXKWN7RME7ZJ62BIY2PSG733DEZS52QTRR5745IPLYUX542CQC
ORRSP7FVCHI2TF5GXBRGQYYJAA3JFYXZBM3T663BKSBV22FCZVCAC
CZQ3NJ4NQYNXUV5GLD4RI5ISNDDWTUZIL5UA366M6WBHL6SA2EUAC
TSV3KPBRNEPLBTIHZFUCRV53VLQXNVOPCZ5L2RB7FH4RUYQJ6PZQC
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)