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.

patterns & practices Developer Center

On this page:
Features - Handling Exceptions, Defining Exception Handling Policies, Exception Handlers

Features

The Silverlight Exception Handling Application Block supports the following scenarios.

Handling Exceptions

By using the Handle Exception method on the Exception Manager class, you can tell the Exception Handling block to handle a specific exception. To avoid having to create try-catch statements in which to place the HandleException method, you can also use the Process method on the ExceptionManager class. The Process method of the ExceptionManager class executes the code you specify in the delegate (method). If an exception occurs while this code is executing, the Process method sends the exception to the Exception Handling Application Block to be handled using the policy you specify in the parameters of the Process method.

For more information, please read the chapter on Sending an Exception to the Exception Handling Application Block on MSDNĀ®.

Defining Exception Handling Policies

There are two ways you can define exception handling policies. You can either define them in a XAML configuration file or use the fluent configuration API to define your exception handling policies.

For more about configuring the Exception Handling Application Block, please read about Entering Configuration Information on MSDNĀ®.

Exception Handlers

  • The Silverlight Exception Handling Application Block ships with the following exception handlers
  • Wrap handler. This wraps one exception around another.
  • Replace handler. This replaces one exception with another.
  • Logging handler. This formats exception information, such as the message and the stack trace. Then the logging handler passes this information to the Enterprise Library Logging Application Block so that it can be published.

Next Topic | Previous Topic | Home

Last built: July 8, 2011