A pure-lua (well, Moonscript) Error tracker for Garry's Mod.
This addon will watch for errors, do a little investigation, and send a message to a Discord channel for your review.
This is for Server Owners/Operators. This allows server operators to monitor and manage the errors that occur on their server.
Addon developers looking for a way to track their errors automatically across all servers - this is not the tool for you.
A full-rewrite of this addon is nearly complete. It has fixes, new features, design reworks, discord ratelimit prevention, reliability improvements, and more.
Please keep an eye out for the update!
You can track its progress (or ask questions) in our support Discord: https://discord.gg/5JUqZjzmYJ
addons/
dir), err_forwarder will generate a link to github.com, showing you the exact line that erroredSimple
addons
directory.Source Controlled
addons
directory, but be sure to check out the lua
branch which contains the compiled Lua from the latest release.git clone --single-branch --branch lua git@github.com:CFC-Servers/cfc_err_forwarder.git
cfc_err_forwarder_interval
: The interval (in seconds) at which errors are parsed and sent to Discordcfc_err_forwarder_server_webhook
: The full Discord Webhook URL to send Serverside errorscfc_err_forwarder_client_webhook
: The full Discord Webhook URL to send Clientside errorscfc_err_forwarder_client_enabled
: A boolean indicating whether or not the addon should even track Clientside errorscfc_err_forwarder_bucket_size
: Client -> Server rate limiting bucket size. (Only applies when not using the luaerror dll)CFC_ErrorForwarder_PreQueue
Called before an Error is queued to be processed.
Return false
to prevent it from being queued.
You may also (carefully) modify the error structure.
With the following code:
-- addons/example/lua/example/init.lua
AddCSLuaFile()
if SERVER then return end
local function exampleFunction()
print( 5 + {} )
end
hook.Add( "InitPostEntity", "Example", function()
ProtectedCall( exampleFunction )
end )
The error structure would look like: | Name | Type | Example | Description |
---|---|---|---|---|
branch |
string |
"unknown" (Base branch) |
The game branch where the error occurred. Is either "Not sure yet" if the client errored early, or BRANCH string |
|
count |
number |
1 |
How many times this error has occurred _(Will always be 1 in CFC_ErrorForrwarder_PreQueue )_ |
|
errorString |
string |
"attempt to perform arithmetic on a table value" |
The actual error message that was produced | |
fullError |
string |
The full, raw, multiline error string with a simplified stack | ||
isClientside |
boolean |
true |
Whether or not this error occurred on a client | |
isRuntime |
boolean |
true |
"Whether this is a runtime error or not" - taken straight from gm_luaerror |
|
occurredAt |
number |
1704534832 |
The result of os.time() of when the error occurred |
|
ply |
Player |
Player [1][Phatso] |
The Player who experienced the error, or nil if serverside |
|
plyName |
string |
"Phatso" |
nil if serverside |
|
plySteamID |
string |
"STEAM_0:0:21170873" |
nil if serverside |
|
reportInterval |
number |
60 |
In seconds, how often the addon is sending errors to Discord | |
sourceFile |
string |
"addons/test/lua/example/init.lua" |
The file path where the error occurred | |
sourceLine |
number |
4 |
The line in the file where the error occurred | |
stack |
table |
{ 1 = { currentline = 4, name = "unknown", source = "..." }, ... } |
A numerically indexed Stack object |
CFC_ErrorForwarder_OnReceiveCLError
This hook is only called when the luaerror
dll is not installed.
This hook is called in the network receiver that is triggered when a player forwards their error to the server.
Return false
to prevent it from being processed.