logoalt Hacker News

leni536yesterday at 1:58 PM1 replyview on HN

Any fallible cleanup function is awkward, regardless of error handling mechanism.


Replies

layer8yesterday at 3:43 PM

Java solved it by having exceptions be able to attach secondary exceptions, in particular those occurring during stack unwinding (via try-with-resources).

The result is an exception tree that reflects the failures that occurred in the call tree following the first exception.