Article on Error Handling

Yesterday, I came across this interesting article Handling errors is canceling operations. While it’s mostly focused on C++, I found most of it being generic enough, that it also fits with other languages.

The most interesting section to me, was the following paragraph:

Exception handling is not a tool for broadcasting information about anyĀ failure in the system: it is a tool for declaring the success/failure dependency between operations and controlling how the cancellation cascade proceeds. If there is no need to cancel subsequent operations, you do not throw: use other means for broadcasting information about the failure, e.g. logging or some global state.

Andrzej’s C++ blog

Leave a Comment

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.