void call_callback(function f,mixed ... args) { mixed err; err=catch { f(@args); return; }; werror(master()->describe_backtrace(err)); }
You should probably use master()->handle_error() instead:
void call_callback(function f,mixed ... args) { mixed err; err=catch { f(@args); return; }; if (err) master()->handle_error(err); }
/ Henrik Grubbström (Lysator)
Previous text:
2003-12-08 10:24: Subject: call_callback
Is there any utility function in Pike that does the following, or an approximate?
void call_callback(function f,mixed ... args) { mixed err; err=catch { f(@args); return; }; werror(master()->describe_backtrace(err)); }
...preferably with typechecking.
I find that I would like to put a wrapper around my callbacks a lot of the time, to be certain that the code following still is run even if the user (of my library-ish routines) makes an error.
/ Mirar