UseExceptionHandler configures exception handling in the ASP.NET Core request pipeline. It can reexecute requests through an error endpoint or run custom middleware logic directly. section 6.2.4
Important implementation details:
- The reexecuted request keeps the original HTTP method, so an error endpoint should not be limited to one verb unless separate handlers are intentional. section 6.2.4
Inline exception handling
UseExceptionHandler can accept an action that runs middleware directly. The handler serializes ProblemDetails to JSON and writes it into the HTTP response.
