Handling Exceptions in a Structured Manner

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

All applications should handle errors in order to protect the application execution and to provide information for users, operators, administrators, and developers. Within .NET Framework applications, the most common scenario is handling exceptions raised by the application code, executing suitable recovery tasks where practicable, and raising the exception to the calling code or user interface.

The Policy Injection Application Block provides a handler that takes advantage of the features exposed by the Enterprise Library Exception Handling Application Block. These features allow developers to create a consistent strategy for processing exceptions that occur in all architectural layers of an enterprise application, they allow administrators to define and maintain exception handling policies, and they support the following:

  • Logging exception information
  • Hiding sensitive information by replacing the original exception with another exception
  • Wrapping exceptions inside a new exception to maintain contextual information
  • Combining these tasks so that, for example, the application block will log the information from an exception and then replace the original exception with another

For more details about structured exception handling using the Policy Injection Application Block, see The Exception Handling Handler in the section Configuring and Using Custom Matching Rules.

The Exception Handling Application Block provides a comprehensive set of features for handling exceptions. For details about using the Exception Handling Application Block, see Introduction to the Exception Handling Application Block.

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.
Show: