diff --git a/aspnetcore/web-api/handle-errors.md b/aspnetcore/web-api/handle-errors.md index 21bede8e1d..0752bf1398 100644 --- a/aspnetcore/web-api/handle-errors.md +++ b/aspnetcore/web-api/handle-errors.md @@ -329,3 +329,8 @@ Use the ## Custom Middleware to handle exceptions The defaults in the exception handling middleware works well for most apps. For apps that require specialized exception handling, consider [customizing the exception handling middleware](xref:fundamentals/error-handling#exception-handler-lambda). + +### Producing a ProblemDetails payload for exceptions + +ASP.NET Core doesn't produce a standardized error payload when the server encounters an unhandled exception. For scenarios where it is desireable to return a standardized [ProblemDetails response](https://datatracker.ietf.org/doc/html/rfc7807) to the client, the [ProblemDetails middleware](https://www.nuget.org/packages/Hellang.Middleware.ProblemDetails/) can be used to map exceptions and 404s to a [ProblemDetails](xref:web-api/handle-errors#pd) payload. The exception handling middleware can also be used to return a payload for unhandled exceptions. +