Hmm, yes it fits better in the sense that "break" everywhere else means "continue after the end of some surrounding block".
I'm not sure that's relevant. Look at
foo: for(;;) { try {...}
onerror (Exception e) { if (e->error1) continue; else if (e->error2) break; else if (e->error3) continue foo; else break foo; } }
Here, both break foo and continue foo should go on executing without rethrowing the exception, right? The question is what a break and continue for the onerror block should do.
My gut reaction was that continue should rethrow the exception, and break ends the error handling. I guess that's because I think of the error handling code as part of larger context which includes other onerror blocks elsewhere in the call chain.
/ Niels Möller (igelkottsräddare)
Previous text:
2003-10-02 00:26: Subject: Re: throw or return
Hmm, yes it fits better in the sense that "break" everywhere else means "continue after the end of some surrounding block".
In this case I thought "continue" was more natural since the alternative to the default rethrow is better described as to "continue" with the normal program flow rather than "break"ing something. It also weaves better with a switch block since no labels are necessary then to tell which construct the breaks apply to.
/ Martin Stjernholm, Roxen IS