8.2. Exception Handling

Most .NET languages support structured exception handling. Essentially, when an error occurs in your application, the .NET Framework creates an exception object that represents the problem. You can catch this object using an exception handler. If you fail to use an exception handler, your code will be aborted, and the user will see an error page.

Structured exception handling provides several key features:

Exceptions are object-based

Each exception provides a significant amount of diagnostic information wrapped into a neat object, instead of a simple message and an error code. These exception objects also support an InnerException property that allows you to wrap a generic error over the more specific error that caused ...

Get Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.