In MVC3, I have CustomErrors enabled this way:
<customErrors mode="On" defaultRedirect="/Error/Generic"/>
And It works whatever I add or not the HandleErrorAttribute to the GlobalFilterCollection filters.
In void Application_Start(), it does not change anything if I comment out this line
RegisterGlobalFilters (GlobalFilters.Filters);
What is the real purpose of this call to RegisterGlobalFilters?
This is working because you still have a defaultRedirect specified.
If you remove it, your custom errors will not work if you have customErrors="On" and do not have either `HandleError specified OR if you comment out:
RegisterGlobalFilters(GlobalFilters.Filters);
So in short - you do need to register your global filters if you want this to work and have the error details properly pushed through, otherwise I don't think your HandleErrorInfo values will be accessible in /Error/Generic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With