Skip to content

Commit 640900c

Browse files
IProblemDetailsWriter (#27255)
* IProblemDetailsWriter * IProblemDetailsWriter
1 parent d16f92e commit 640900c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

aspnetcore/web-api/handle-errors.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn about error handling with ASP.NET Core web APIs.
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 9/23/2022
8+
ms.date: 10/14/2022
99
uid: web-api/handle-errors
1010
---
1111
# Handle errors in ASP.NET Core web APIs
@@ -292,6 +292,12 @@ An alternative to a [custom exception handler page](xref:fundamentals/error-hand
292292
293293
[Hellang.Middleware.ProblemDetails](https://www.nuget.org/packages/Hellang.Middleware.ProblemDetails/) is a 3rd party problem details middleware Nuget package.
294294

295+
### Implement `IProblemDetailsWriter`
296+
297+
An <xref:Microsoft.AspNetCore.Http.IProblemDetailsWriter> implementation can be created for advanced customizations:
298+
299+
:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/middleware/problem-details-service/SampleProblemDetailsWriter.cs" :::
300+
295301
### Implement `ProblemDetailsFactory`
296302

297303
MVC uses <xref:Microsoft.AspNetCore.Mvc.Infrastructure.ProblemDetailsFactory?displayProperty=fullName> to produce all instances of <xref:Microsoft.AspNetCore.Mvc.ProblemDetails> and <xref:Microsoft.AspNetCore.Mvc.ValidationProblemDetails>. This factory is used for:

0 commit comments

Comments
 (0)