exception handler middleware

ASP.NET Core middleware, added with app.UseExceptionHandler(), that catches unhandled exceptions from later components and returns a safe error response.

In more detail

Put it first so it surrounds everything. Combined with AddProblemDetails it returns a Problem Details body and logs the exception without exposing internals.

Related terms

Taught in

References