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?
Share
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!