Exception Handling Module

Topics: CAB & Smart Client Software Factory
Feb 22, 2007 at 9:21 AM
Hi guys.

It's time to handle my application exceptions, and I want to know which is the better way for doing this.

Handling each exception in their own or create a Foundational Module for handlling exceptions (Show messages, Logging application Block, etc...)

I'm very newbie with exceptions, and i don't know why, but... I Hate Them!!!
Feb 22, 2007 at 10:09 AM
create a Foundational Module for handlling exceptions

I would say 'No' to that idea because a Foundation Module becomes a work Item and get placed in a heiracy of WorkItems, so it would not be availble to all work Items in your application.

I would suggest you should read up on how Enterprise Library handles Exceptions and then you'll really be confused #$%$#%&^ - NO I mean then you will have a better handle on the options availble to you.

What I like about the Enterprise Library solution is that exceptions when they occur can be handled by a single line of code.
From that moment on your application refers to you app.config (or Web.config) where you have set up rules on how each exception should be handled. The options are infinite but in broad terms you can log the incident, send an email, or display a dialog message.

Once you have a better handle on the ExceptionHandler Application Block, then you may be comming back here and asking - should I handle my exception in a service... but that's another discussion.
Feb 22, 2007 at 12:31 PM
Thank's for your help. I'll read again the Exception Handling application block and begin fighting again it :)