-
-
Notifications
You must be signed in to change notification settings - Fork 180
Open
Labels
Description
Error message from pcall only include the first line that error happened but not the full stack traceback, but this can be done by compiling to using xpcall
and pass debug.traceback
as second arg:
local result
local function ____catch(err)
print("catch:", err)
end
local ____try, ____hasReturned = xpcall(
function()
result = dosomething(args)
end,
debug.traceback
)
if not ____try then
____catch(____hasReturned)
end
Although custom plugin can implement this feature, but plugin can not rewrite lualib such as pcall in Promise.lua