mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:07:34 +00:00
add error reporter
This commit is contained in:
parent
e694dcddcd
commit
d2312f55a9
25
lua/gmod_integration/shared/sh_errors.lua
Normal file
25
lua/gmod_integration/shared/sh_errors.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// Methods
|
||||
//
|
||||
|
||||
function gmInte.sendLuaErrorReport(err, realm, stack, name, id)
|
||||
if (name !== "gmod_integration") then return end
|
||||
gmInte.http.post("/errors",
|
||||
{
|
||||
["error"] = err,
|
||||
["realm"] = realm,
|
||||
["stack"] = stack,
|
||||
["name"] = name,
|
||||
["id"] = id,
|
||||
["identifier"] = SERVER && gmInte.config.id || LocalPlayer():SteamID64()
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
//
|
||||
// Hooks
|
||||
//
|
||||
|
||||
hook.Add("OnLuaError", "gmInte:OnLuaError:SendReport", function(err, realm, stack, name, id)
|
||||
gmInte.sendLuaErrorReport(err, realm, stack, name, id)
|
||||
end)
|
Loading…
Reference in New Issue
Block a user