Simberon Design Minute
 

Masking Exceptions

A practice I often see in object oriented development is an over-zealous attempt to handle exceptions. When an exception is raised, you do want to have a handler for it in order to give the user an appropriate error message instead of simply crashing the application. It's also a good idea to simplify the error message so the user doesn't get the cryptic text that is usually intended for developers to use to diagnose the problem. In some cases, though, I've seen developers handle the exceptions and quietly ignore them. This can cause huge problems. The biggest problem is that things can start going terribly wrong and nobody ever knows. The best way to handle errors is to give a message to the user indicating that the error occurred and then to create a complete stack trace file for the developers to look at to help them figure out the problem. Ideally, you'll have some way of getting these tracebacks back to the developers easily and automatically so they can fix the problem even without having the user complain about it. Just masking the exception and pretending it never happened is probably the worst way to handle exceptions.

Download