Attempting to run a fuction when a server-side error occurs.
2 replies, posted
So to make this short and sweet, I'm trying to code an add-on that'll basically attempt to catch a server error, and run a function to result a file containing "1" and another file that'll contain the error in its entirety. This is to help with CI.
After looking in the docs and wiki, all I see are things for the menu realm. If someone can point the way, I would love them.
States, did you try anything already?
Don't know what you mean by the link to States, however, what I've tried is using a binary module, however, I am not sure that it works, or if I'm using it properly.
I also think that I shouldn't need to use a binary module for this to be completely honest, but hey, first time trying to code Lua.
if SERVER then
print("GMod Lua ErrorChecker for CI Integration is now loaded server-side.")
hook.Add("LuaError", "Error receiver", function(is_runtime_error, full_error, source_file, source_line, error_string, stack_table)
print(is_runtime_error, full_error, source_file, source_line, error_string, "No")
print("Errors are working through this addon")
-- Placeholder for file
-- Placeholder for file
if stack_table ~= nil
then PrintTable(stack_table)
end
return true
end)
end
Sorry, you need to Log In to post a reply to this thread.