Add a default love.threaderror callback which just calls error().

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-08-06 21:42:05 -03:00
parent b5f2bce0a6
commit 98eef9e88a
2 changed files with 26 additions and 15 deletions
+8 -5
View File
@@ -547,6 +547,10 @@ function love.init()
end
end
-----------------------------------------------------------
-- Default callbacks.
-----------------------------------------------------------
function love.run()
if love.load then love.load(love.arg.parseGameArguments(arg), arg) end
@@ -592,11 +596,11 @@ function love.run()
end
-----------------------------------------------------------
-- Error screen.
-----------------------------------------------------------
local debug, print, error = debug, print, error
local debug, print = debug, print
function love.threaderror(t, err)
error("Thread error ("..tostring(t)..")\n\n"..err, 0)
end
local function error_printer(msg, layer)
print((debug.traceback("Error: " .. tostring(msg), 1+(layer or 1)):gsub("\n[^\n]+$", "")))
@@ -720,7 +724,6 @@ local function deferErrhand(...)
return handler(...)
end
-----------------------------------------------------------
-- The root of all calls.
-----------------------------------------------------------