Modified output of error_printer to no longer show the error handlers or the 'main chunk'

This commit is contained in:
bart@bartbes.ath.cx
2010-04-17 22:01:56 +02:00
parent 43125c3fb4
commit bc4ea90eb5
+3 -3
View File
@@ -766,13 +766,13 @@ end
local debug = debug
local function error_printer(msg)
print((debug.traceback("Error: " .. msg, 3):gsub("\n[^\n]+$", "")))
local function error_printer(msg, layer)
print((debug.traceback("Error: " .. msg, 1+(layer or 1)):gsub("\n[^\n]+$", "")))
end
function love.errhand(msg)
error_printer(msg)
error_printer(msg, 2)
if not love.graphics or not love.event or not love.graphics.isCreated() then
return