Hacker News new | ask | show | jobs
by toxik 4453 days ago
I thought that was called try...finally
2 comments

Yes, as noted, it's a three part structure:

try { MayThrowException(); } catch(MyExceptionType ex) { HandleIfException(ex); } finally { AlwaysRunCleanupRegardless(); }

No, finally is always executed. The catch handler only executes when there's an exception.