With the onerror construct,
try ... onerror (Err x) { }
*all* errors will be handled. You need to differ between the errors you take care of and those you don't care about, so you can do
... onerror (Err x) { if (x is my special error) { handle_it(x); break; // don't rethrow } // rethrow }
for instance. I think rethrowing an unhandled error this way is a good idea.
/ Mirar
Previous text:
2003-10-02 00:23: Subject: Re: throw or return
On Thu, Oct 02, 2003 at 12:15:01AM +0200, Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
"Avoid rethrow" means to continue after the statement. The default is to throw the error again after executing the onerror clause (and the finally clause, if there is any).
What is the point to implicitly "rethrow" an exception which is handled?
Or, make it another way - what is the point to handle an exception to rethrow it?
Regards, /Al
/ Brevbäraren