mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
Add a default love.threaderror callback which just calls error().
--HG-- branch : minor
This commit is contained in:
@@ -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.
|
||||
-----------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user