tostring all errors in the error handler (issue #332)

This commit is contained in:
Bart van Strien
2011-12-06 21:55:16 +01:00
parent 1503533ee6
commit a003f5d581
2 changed files with 9 additions and 5 deletions
+2 -1
View File
@@ -667,10 +667,11 @@ end
local debug = debug local debug = debug
local function error_printer(msg, layer) local function error_printer(msg, layer)
print((debug.traceback("Error: " .. msg, 1+(layer or 1)):gsub("\n[^\n]+$", ""))) print((debug.traceback("Error: " .. tostring(msg), 1+(layer or 1)):gsub("\n[^\n]+$", "")))
end end
function love.errhand(msg) function love.errhand(msg)
msg = tostring(msg)
error_printer(msg, 2) error_printer(msg, 2)
+7 -4
View File
@@ -1642,12 +1642,15 @@ const unsigned char boot_lua[] =
0x79, 0x65, 0x72, 0x29, 0x0a, 0x79, 0x65, 0x72, 0x29, 0x0a,
0x09, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2e, 0x74, 0x72, 0x61, 0x63,
0x65, 0x62, 0x61, 0x63, 0x6b, 0x28, 0x22, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x20, 0x22, 0x20, 0x2e, 0x2e, 0x65, 0x62, 0x61, 0x63, 0x6b, 0x28, 0x22, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x20, 0x22, 0x20, 0x2e, 0x2e,
0x20, 0x6d, 0x73, 0x67, 0x2c, 0x20, 0x31, 0x2b, 0x28, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x6f, 0x72, 0x20, 0x20, 0x74, 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x6d, 0x73, 0x67, 0x29, 0x2c, 0x20, 0x31, 0x2b,
0x31, 0x29, 0x29, 0x3a, 0x67, 0x73, 0x75, 0x62, 0x28, 0x22, 0x5c, 0x6e, 0x5b, 0x5e, 0x5c, 0x6e, 0x5d, 0x2b, 0x28, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x6f, 0x72, 0x20, 0x31, 0x29, 0x29, 0x3a, 0x67, 0x73, 0x75, 0x62,
0x24, 0x22, 0x2c, 0x20, 0x22, 0x22, 0x29, 0x29, 0x29, 0x0a, 0x28, 0x22, 0x5c, 0x6e, 0x5b, 0x5e, 0x5c, 0x6e, 0x5d, 0x2b, 0x24, 0x22, 0x2c, 0x20, 0x22, 0x22, 0x29, 0x29,
0x29, 0x0a,
0x65, 0x6e, 0x64, 0x0a,0x0a, 0x65, 0x6e, 0x64, 0x0a,0x0a,
0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x65, 0x72, 0x72, 0x68, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x65, 0x72, 0x72, 0x68,
0x61, 0x6e, 0x64, 0x28, 0x6d, 0x73, 0x67, 0x29, 0x0a,0x0a, 0x61, 0x6e, 0x64, 0x28, 0x6d, 0x73, 0x67, 0x29, 0x0a,
0x09, 0x6d, 0x73, 0x67, 0x20, 0x3d, 0x20, 0x74, 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x6d, 0x73,
0x67, 0x29, 0x0a,0x0a,
0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x6d, 0x73, 0x67, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x6d, 0x73, 0x67,
0x2c, 0x20, 0x32, 0x29, 0x0a,0x0a, 0x2c, 0x20, 0x32, 0x29, 0x0a,0x0a,
0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,