File tree Expand file tree Collapse file tree
src/Middleware/Diagnostics/src/StatusCodePage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ public static class StatusCodePagesExtensions
2020 /// <summary>
2121 /// Adds a StatusCodePages middleware with the given options that checks for responses with status codes
2222 /// between 400 and 599 that do not have a body.
23+ /// If <see cref="StatusCodePagesOptions.HandleAsync"/> uses its default value, it attempts to generate a
24+ /// <see cref="Microsoft.AspNetCore.Mvc.ProblemDetails"/> response using <see cref="IProblemDetailsService"/>
25+ /// and falls back to a plain text response that includes the status code.
2326 /// </summary>
2427 /// <param name="app"></param>
2528 /// <param name="options"></param>
@@ -33,8 +36,11 @@ public static IApplicationBuilder UseStatusCodePages(this IApplicationBuilder ap
3336 }
3437
3538 /// <summary>
36- /// Adds a StatusCodePages middleware with a default response handler that checks for responses with status codes
37- /// between 400 and 599 that do not have a body.
39+ /// Adds a <see cref="StatusCodePagesMiddleware"/> with the default response handler.
40+ /// The middleware checks for responses with status codes between 400 and 599 that do not have a body and,
41+ /// when an <see cref="IProblemDetailsService"/> is available, attempts to generate a
42+ /// <see cref="Microsoft.AspNetCore.Mvc.ProblemDetails"/> response. If the service is unavailable or cannot write the response,
43+ /// it generates a plain text response that includes the status code.
3844 /// </summary>
3945 /// <param name="app"></param>
4046 /// <returns></returns>
Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ namespace Microsoft.AspNetCore.Builder;
1515public class StatusCodePagesOptions
1616{
1717 /// <summary>
18- /// Creates a default <see cref="StatusCodePagesOptions"/> which produces a plaintext response
19- /// containing the status code and the reason phrase.
18+ /// Creates a default <see cref="StatusCodePagesOptions"/> whose handler attempts to generate a
19+ /// <see cref="Microsoft.AspNetCore.Mvc.ProblemDetails"/> response using <see cref="IProblemDetailsService"/>, and falls back
20+ /// to a plaintext response containing the status code and reason phrase when that service is unavailable
21+ /// or cannot write a response.
2022 /// </summary>
2123 public StatusCodePagesOptions ( )
2224 {
@@ -52,7 +54,10 @@ private static string BuildResponseBody(int httpStatusCode)
5254 }
5355
5456 /// <summary>
55- /// The handler that generates the response body for the given <see cref="StatusCodeContext"/>. By default this produces a plain text response that includes the status code.
57+ /// The handler that generates the response body for the given <see cref="StatusCodeContext"/>.
58+ /// By default this attempts to generate a <see cref="Microsoft.AspNetCore.Mvc.ProblemDetails"/> response
59+ /// using <see cref="IProblemDetailsService"/> and falls back to a plain text response that includes the
60+ /// status code.
5661 /// </summary>
5762 public Func < StatusCodeContext , Task > HandleAsync { get ; set ; }
5863
You can’t perform that action at this time.
0 commit comments