mirror of
https://github.com/Dadido3/noita-mapcap.git
synced 2024-11-22 21:17:33 +00:00
Display stacktrace with Message:CatchException
This commit is contained in:
parent
6a016ed0b9
commit
78b2812593
@ -35,8 +35,10 @@ end
|
|||||||
---@param id string
|
---@param id string
|
||||||
---@param func function
|
---@param func function
|
||||||
function Message:CatchException(id, func)
|
function Message:CatchException(id, func)
|
||||||
local ok, err = pcall(func)
|
local ok, err = xpcall(func, debug.traceback)
|
||||||
if not ok then
|
if not ok then
|
||||||
|
|
||||||
|
print(string.format("An exception happened in %s: %s", id, err))
|
||||||
self:ShowRuntimeError(id, string.format("An exception happened in %s", id), err)
|
self:ShowRuntimeError(id, string.format("An exception happened in %s", id), err)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user