IProblemDetailsService generates Problem Details responses for errors in ASP.NET Core applications. Register it with AddProblemDetails() so exception-handling middleware can produce an error response without a dedicated error endpoint. section 5.3.3
Configure automatic exception responses
Register the service, configure UseExceptionHandler() without a path, and throw an exception from an endpoint. ExceptionHandlerMiddleware then uses IProblemDetailsService to generate the response.
