I would prefer
catch { Stdio.format_filesystem("/dev/hda2", "ext5"); } handle (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; }
and would think this to be even better
catch { Stdio.format_filesystem("/dev/hda2", "ext5"); } handle (Exception e) { if(e->invalid_file_system_type) { // invalid file system type break; } if(e->no_permission || e->not_mounted) { // no permission or filesystem mounted break; } }
/ Martin Nilsson (saturator)
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