amxmodx
amxmodx copied to clipboard
[FEATURE REQUEST] Catch plugin errors
Forward Example
forward plugin_error(error_log[]) // or something similar
Use of forward
- Push the error to an api, such as a discord webhook to get notified instantly
plugin_log()
will execute on server_print
Maybe you should check set_error_filter()
Can you provide an example? This doesn't seem to work
#include <amxmodx>
#include <fun>
public plugin_init(){
register_srvcmd("func", "func")
set_error_filter("error")
}
public func(){
spawn(0)
}
public error(error_code, bool:debugging, message[]){
server_print("ERROR[%d][%s]", error_code, message)
}
This doesn't seem to work
-
Compiles, (re)starts hlds (win), runs "func" * Doesn't work
-
Renames error filter callback to "asdfg", "asdfgh", "asdfghj" & "asdfghjk" and tries again * Doesn't work either
-
Renames error filter callback randomly to "ohmygah" and gives another try * Works
I don't know why it's working like that, but somebody should check it too