I still like the switch-like structure best, mainly because it's very easy to detect what's unhandled.
/ Per Hedbor ()
Previous text:
2003-10-02 00:25: Subject: Re: throw or return
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