April 2002
Intermediate to advanced
1024 pages
23h 26m
English
When used properly, exceptions can add to an application's stability and robustness. The .NET Framework and the CLR have made exception handling mandatory, but at the same time, exceptions have never been easier to use and extend. In the interest of better exception and error handling, the following guidelines should prove beneficial:
Because it is so easy to handle and generate exceptions, great care should be taken to make sure you know when not to rely on exceptions. If, for example, an object can be tested for an invalid condition (such as null) to avoid having an exception raised, then do so. Suppose that you have an object that must be closed to free up the resources it was using, but closing an already closed object resulted in ...