Er? Let's say you do a file operation, and want to catch if you get permission denied:
try { rm("fil"); } onerror (Error e) { if (e->permissiondenied) { werror("Permission denied when removing fil!\n"); break; //? } }
you also catch "out of memory", "out of stack", "no such file or directory", and probably a ton of errors I can't think of right now.
If the error isn't rethrown here, all those other errors will just go into the bit bucket, and your beard will grow white in the effort of tracing down that error that you caught but didn't report.
/ Mirar
Previous text:
2003-10-02 17:34: Subject: Re: throw or return
On Thu, Oct 02, 2003 at 05:25:03PM +0200, Mirar @ Pike developers forum wrote:
Exactly. And since Pike programmers almost by definition are lazy, lets make the default behaviour what you almost always want to do, that is rethrow the error...? :-)
Uhm... It seems logical, but... it is a bit unlogical... As I said before, there is no point to handle an error to rethrow it... Perhaps it makes sense to invent some mandatory statement to explicitly specify an action - say, rethrow or escalate and dismiss. Using of break and continue is bad option, IMHO...
Regards, /Al
/ Brevbäraren