Reputation: 5916
I've just migrated a MVC3 project to a 4.
I also installed the newest update of ELMAH.
I do have an issue with unhandled exceptions.
In my web.config I have this:
<customErrors mode="On" defaultRedirect="/Error/Error" redirectMode="ResponseRedirect">
<error statusCode="404" redirect="/Error/NotFound" />
</customErrors>
When I get an unhandled exception, Elmah logs it, no problem there, but it doesnt send me to the Error/Error view. It also doesn't do the 'ResponseRedirect'
What it does instead is keep the URL as it was, and it shows me the Error.aspx view from the Shared folder.
How do I change the settings somewhere, that the customErrors won't be ignored?
Upvotes: 0
Views: 539
Reputation: 32758
If you are seeing the Error.aspx
page then definitely HandleError
filter is playing behind it. Go to Global.asax.cs
and check HandleErrorAttribute
is not added in the RegisterGlobalFilters
method.
Also make sure you haven't overridden the OnException
method of the controller and doing something manually yourself.
Upvotes: 2