In the WebAPI running in OWIN, you can do this:
config.Services.Replace(typeof(IExceptionHandler), new CustomExceptionHandler());
This allows you to perform custom code processing of all errors that may be reset, even if they are thrown by the controller constructor or during routing.
In MVC, you can add a global exception filter, but it only works for errors that occur after the code gets into the action of the controller.
Is there an equivalent above for global MVC error handling?
source
share