Replace IExceptionHandler in Web Api 2.2 with OWIN middleware exception handler
问题 I have created an OWIN middleware to catch exceptions. The middleware does nothing really but wrap the next call with try catch like this try { await _next(environment) } catch(Exception exception){ // handle exception } The problem is that the middlware is not capturing the exception because the exception is been handled by the default implementation of IExceptionHandler which returns an xml with the stack trace. I understand that I can replace the default IExceptionHandler implementation