-
-
Save FlorianLeChat/8776a5eb28fd8297a83139358ab57746 to your computer and use it in GitHub Desktop.
Allows to handle errors in a customized way and without going through the default features of Garry's Mod.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ErrorHandler = _R[1] | |
_R[1] = function(...) | |
-- We retrieve some information about the error. | |
local data = { | |
path = table.concat({...}), | |
trace = debug.traceback() | |
} | |
-- Then, you can make an HTTP request or trigger a hook for other scripts. | |
-- http.Post("url", data) | |
-- hook.Run("OnLuaError", data) | |
-- Finally, we call the old function in order not to break the function. | |
return ErrorHandler(...) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment