tags:

views:

32

answers:

1

I am in the process of making sure our MVC app catches all exceptions and reports them to us so we can stay on top of the errors. I already learned that I need some code in the Global.asax Application_Error event to catch exceptions that never make it to the Controller, and that in our custom base Controller we override the OnException() method and that seems to work for Controller exceptions. What I am wondering is will View exceptions fall back to that or is there some other thing I need to implement to catch all those?

A: 

Ryan, we have solved this by implementing ErrorAttribute in our Custom Controller Base Class (so that we only put it once in the whole application), this way the users won't see the nasty Yellow Screen of death.

To log unhandled error I'd suggest using ELMAH as a logging error solution, it is VERY unobtrusive (just configuring the web.config) and it has a very nice interface to filter, search and you can even subscribe to it by RSS.

Good Luck!

sabanito
Hmm how will my web.config know where the Elmah.DLL is? I looked through the different web.config entries and I don't see anything to tell it where it is... </confusion>
shogun
or maybe I do have to do more than just web.config, add it as a reference in the project?
shogun
OK I tried getting elmah to work but it won't, how frustrating, it seemed to have so much promise too, i followed the directions EXACTLY but to no avail
shogun
You just have to put the DLL in your bin folder. Let me know if this doesn't work for you.
sabanito