Anyone know how to turn off the default error page or where it’s referenced??
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Alright, I figured it out.
Turns out that in my custom ElmahHandleErrorAttribute class, the OnException() method is indeed over ridden (as it should be). But the 1st line of code is “MyBase.OnException(context)”, which will fire off what the HandleError attribute also performs.
Once I commented out that one line, my issue went away.
What’s The Issue?
I have Elmah.Mvc implemented in this Mvc4 project, it’s working beautifully. I also have a custom errors section in the Web.config as follows:
I have an ErrorController with two action methods, one for “General” and the other for “Http404”.
What was happening was if I raised an unhandled error, I would indeed get my raised exception logged in Elmah, an email delivered with the exception, and then the custom “General” view displayed (Http404 page if it was a 404 error).
BUT, what I was also getting was an additional logged exception AND email because the default “Error.vbhtml” file was not found (I removed that view).
Honest mistake…hope this helps someone out moving along. 🙂