mirror of
https://gitlab.com/hoggit/developers/hoggit.git
synced 2025-11-10 15:43:28 +00:00
15 lines
288 B
Lua
15 lines
288 B
Lua
HandleError = function(err)
|
|
log("Error in pcall: " .. err)
|
|
log(debug.traceback())
|
|
return err
|
|
end
|
|
|
|
try = function(func, catch)
|
|
return function()
|
|
local r, e = xpcall(func, HandleError)
|
|
if not r then
|
|
return catch(e)
|
|
end
|
|
return r
|
|
end
|
|
end |