Browse Source

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

[email protected] 15 years ago
parent
commit
bc4ea90eb5
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/scripts/boot.lua

+ 3 - 3
src/scripts/boot.lua

@@ -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