On Thu, 24 Oct 2019 at 16:38, Mike Schinkel <m...@newclarity.net> wrote:

> > Here, try() would swallow only FileException, other exceptions are still
> > thrown. I'm not sure if this construct is worth introducing though, the
> > difference compared to a proper try / catch is much smaller.
>
> I would want it to capture every exception. Why not?



Because you might want to convert "FileLockedByAnotherProcessException" to
a locally-handled error, but allow "ServerIsOnFireException" to bubble up
to a higher-level exception handler.  That's why catch blocks basically
force you to specify class/interface names: you should catch only the
exceptions you actually know how to handle in that particular piece of code.

Regards,
-- 
Rowan Tommins
[IMSoP]

Reply via email to