Ensure error and stack trace are written to stdout

To address https://github.com/franko/lite-xl/issues/87
This commit is contained in:
Francesco Abbate
2021-03-07 09:48:44 +01:00
parent 199476547b
commit 23a053e1ee
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -879,7 +879,7 @@ function core.on_error(err)
-- write error to file
local fp = io.open(USERDIR .. "/error.txt", "wb")
fp:write("Error: " .. tostring(err) .. "\n")
fp:write(debug.traceback(nil, 4))
fp:write(debug.traceback(nil, 4) .. "\n")
fp:close()
-- save copy of all unsaved documents
for _, doc in ipairs(core.docs) do