mirror of https://github.com/bjornbytes/lovr.git
Fix errhand loop when debug library is unavailable;
(cherry picked from commit dacc17e1b7
)
This commit is contained in:
parent
8c3c0f8136
commit
1f6904c04b
|
@ -147,7 +147,7 @@ local function formatTraceback(s)
|
||||||
end
|
end
|
||||||
|
|
||||||
function lovr.errhand(message)
|
function lovr.errhand(message)
|
||||||
message = 'Error:\n\n' .. tostring(message) .. formatTraceback(debug.traceback('', 4))
|
message = 'Error:\n\n' .. tostring(message) .. formatTraceback(debug and debug.traceback('', 4) or '')
|
||||||
|
|
||||||
print(message)
|
print(message)
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ return function()
|
||||||
errored = true -- Ensure errhand is only called once
|
errored = true -- Ensure errhand is only called once
|
||||||
return lovr.errhand(...) or function() return 1 end
|
return lovr.errhand(...) or function() return 1 end
|
||||||
else
|
else
|
||||||
local message = tostring(...) .. formatTraceback(debug.traceback('', 2))
|
local message = tostring(...) .. formatTraceback(debug and debug.traceback('', 2) or '')
|
||||||
print('Error occurred while trying to display another error:\n' .. message)
|
print('Error occurred while trying to display another error:\n' .. message)
|
||||||
return function() return 1 end
|
return function() return 1 end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue