Unhandled Exceptions

Unhandled exceptions are not handled directly in application code but deferred to a global handler. As the default behavior, the global handler reports the exception in an error box that presents a variety of choices. For applications running under the control of a debugger, the exception is usually trapped in the debugger.

What is the life cycle of an exception? Exceptions are initially categorized as first-chance exceptions. If the application is running under the auspices of a debugger, the debugger is first consulted about the exception. Debuggers typically ignore first-chance exceptions, and the exception is then forwarded to the application. When no debugger is present, the first-chance exception is immediately sent to ...

Get Programming Microsoft® Visual C#® 2008: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.