Skip to content

Add extensible handlers to DeveloperExceptionPage #8536

Closed
@DamianEdwards

Description

@DamianEdwards

Add extensibility point to sub-systems to add handlers via DI that get inspected when an exception occurs. The handler can choose to render a response (e.g. the current EF diagnostic middleware page would change to this) or pass-through (do nothing). The middleware would fallback to rendering an HTML error page if no handler matched and the client sent an Accept header that included text/html, otherwise it would just return the error as plain text. For API responses, MVC would register a handler that formats a ProblemDetails with the relevant information according to the configured formatters.

There's 2 work items here:

  • - Allowing components to take over the rendering of the error page depending on the exception type (like how EF has the database error page)
  • - Rendering a plaintext response if the client isn't a browser (if the Accept header does not contain text/html)

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresenhancementThis issue represents an ask for new feature or an enhancement to an existing one

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions