Global Exception Handler

ExceptionHandler.gif

When an unhandled exception occurs a user friendly message goes a long way towards user confidence in your application. .NET provides good tools for trapping and handling thread and application exceptions. The trick is to make the exception user friendly and get the user to pass that information back to you for evaluation.

Allows the inclusion of a developer defined custom tab that can display and record additional information.

Jeff Atwood, in a contribution on CodeProject, gives a nice template for such a user friendly handler. The IExceptionHandler is loosely based on Jeff Atwood's template. There are three classes which implement the interface:
  • ConsoleExceptionHandler: displays exception information via the standard output.
  • SimpleExceptionHandler: displays exception information via the .NET ThreadExceptionDialog.
  • DxExceptionHandler: displays exception information in a user friendly interface. This is the full featured solution.

Things to finish:
  • Need to write unit tests.

Last edited Jul 4, 2009 at 6:22 PM by DevLynx, version 7

Comments

No comments yet.