0

I have an mvc 3 application with EF 4 and ELMAH logging support.

I have found some articles on exception handling on web but somehow did not have a good feel by any of them.

So let say that currently I do not have any try catc blocks in my app but have ELMAH logging support tuned on.

So this is what I found:

Your system has a good exception management if:

1.It doesn't show unnecessary technical error descriptions when an error occurs, rather, apologize to user with a screen that something went wrong and lets him/her go back to the system.

2.When an error occurs, it immediately notifies technical teams with detailed information for troubleshooting, along with logging error details.

3.It has exception management done in a central and manageable manner without unnecessary try..catch...throw spread across the overall code base.

The first and second I understand. The problem is with third. So a few questions that arised are:

1.How would you implement third requirement in mvc 3?

2.Does HandleErrorAttribute in mvc 3 meet third condition and does not affect ELMAH logging?

3.If I implement HandleErrorAttribute...do I still need try catch statements in models where I am calling let say db.SaveChanges() on EF 4?

Maybe those are basic question but I did not found any really good help on web that would explain those issues.

TheMentor
  • 454
  • 9
  • 25
  • Here is a thread about mvc with ELMAH. http://stackoverflow.com/questions/1061389/elmah-and-exception-management-in-asp-net-mvc As it seems if I use HandleAttribute Elmah logging does not work properly...is it wise to use ELMAH without HandleAttribute? How would you do central exception management in that case? – TheMentor Mar 15 '12 at 23:27
  • 1
    I'd been keen on some input on these topics too as I'm just about to go down the same path. – Id10T-ERROR May 17 '12 at 04:40

0 Answers0