Fix problem with fatal error message

Previous implementation was broken.

Ensure the error file is always written and write its location in the error message
This commit is contained in:
Francesco Abbate
2021-03-05 23:46:41 +01:00
parent 877e4ac6e2
commit 09332fe242
2 changed files with 17 additions and 12 deletions
+1 -1
View File
@@ -877,7 +877,7 @@ end
function core.on_error(err)
-- write error to file
local fp = io.open(EXEDIR .. "/error.txt", "wb")
local fp = io.open(USERDIR .. "/error.txt", "wb")
fp:write("Error: " .. tostring(err) .. "\n")
fp:write(debug.traceback(nil, 4))
fp:close()