Open rochapablo opened 4 years ago
401 (authorization failure) isn't the same thing as an unhandled exception. UseExceptionHandler
is only invoked when an exception is thrown by some code in your application. Authorization failures don't throw exceptions, though.
Are you trying to customize the payload that's returned along with 401?
I'm trying to follow the example, but it seems that
app.UseExceptionHandler
it's called only when I removeapp.UseAuthorization
, but I do needUseAuthorization
. What could I be missing?When I have status 401 for example, It should be calling
JsonExceptionMiddleware.Invoke
before the request response, but the body it's empty.