How about:
try(Exception e) { catch { format(); }
if(e->foobar) { write_error_message(); break; } if(e->gazonk) { fatal_error(); } }
The point of this syntax would be that the exception is automatically re-thrown at the end of the try statement, unless a break is encountered, only then is the error discarded.
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-10-01 20:42: Subject: Re: throw or return
I don't like this syntax very much. The one suggested in the message you commented is nice except that I would write it like this rather:
try { Stdio.format_filesystem("/dev/hda2", "ext5"); } catch (Exception e) { case e->invalid_file_system_type: // invalid file system type break; case e->no_permission; case e->not_mounted: // no permission or filesystem mounted break; }
/ David Hedbor