logoalt Hacker News

trinix912yesterday at 10:24 PM2 repliesview on HN

Sometimes it’s useful to handle the exception somewhere near its origin so you can close related resources, lockfiles, etc. without needing a VB6 style “On Error GoTo X” global error handler that has to account for all different contexts under which the exceptional situation might have occurred.


Replies

PhilipRomanyesterday at 10:42 PM

Your process can crash or be killed at any moment anyway. Depending on in-band cleanup is not reliable.

show 1 reply
matheusmoreirayesterday at 10:58 PM

> a VB6 style “On Error GoTo X” global error handler that has to account for all different contexts under which the exceptional situation might have occurred

... That seems like a pretty accurate description of how exception handling mechanisms are implemented under the hood. :)