Display stacktrace with Message:CatchException

This commit is contained in:
David Vogel 2022-07-28 11:56:14 +02:00
parent 6a016ed0b9
commit 78b2812593

View File

@ -35,8 +35,10 @@ end
---@param id string
---@param func function
function Message:CatchException(id, func)
local ok, err = pcall(func)
local ok, err = xpcall(func, debug.traceback)
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)
end
end