views:

807

answers:

1

I am looking at moving away from the Exception Management Application Block in the Enterprise Library for a new ASP.NET MVC site.

Scott Hansleman's post(s) on ELMAH has caught my eye but I don't fully understand the approach. Typically I would suppress some exceptions (ones that are recoverable), log them in a central repository, and then display a message to the user as appropriate.

ELMAH seems focused on, "Logging of nearly all unhandled exceptions.". What about exceptions I want to handle? Can I use the same repository so there is one central location for all exceptions?

How are people using ELMAH in their applications, is it the only exception handling solution being implemented, or is it used in conjunction with another solution?

+2  A: 

I've been using an implementation Dan Swatik's HandleErrorAttribute extension for ELMAH. Using this it allows you to both handle the error in your code and log it via ELMAH. This was originally from Atif Aziz, and found in this answer to http://stackoverflow.com/questions/766610/how-to-get-elmah-to-work-with-asp-net-mvc-handleerror-attribute.

tvanfosson
score, thank you
blu
Updated link to Dan Swatik's article - http://danswatik.com/post/how-to-get-elmah-to-work-with-aspnet-mvc-handleerror-attribute
Liam
I've changed the link in the answer to match.
tvanfosson
...Thanks, @Liam.
tvanfosson
Dan Swatik link is broken again. Should be:http://danswatik.com/index.php/2009/04/23/how-to-get-elmah-to-work-with-aspnet-mvc-handleerror-attribute/
I Clark
That link doesn't work either :) It keeps moving...
Jedidja