Dela via


ExceptionHandlerOptions Class

Definition

Options for configuring the ExceptionHandlerMiddleware.

public ref class ExceptionHandlerOptions
public class ExceptionHandlerOptions
type ExceptionHandlerOptions = class
Public Class ExceptionHandlerOptions
Inheritance
ExceptionHandlerOptions

Constructors

ExceptionHandlerOptions()

Properties

AllowStatusCode404Response

This value controls whether the ExceptionHandlerMiddleware should consider a response with a 404 status code to be a valid result of executing the ExceptionHandler. The default value is false and the middleware will consider 404 status codes to be an error on the server and will therefore rethrow the original exception.

CreateScopeForErrors

Gets or sets whether the handler needs to create a separate IServiceProvider scope and replace it on RequestServices when re-executing the request to handle an error.

ExceptionHandler

The RequestDelegate that will handle the exception. If this is not explicitly provided, the subsequent middleware pipeline will be used by default.

ExceptionHandlingPath

The path to the exception handling endpoint. This path will be used when executing the ExceptionHandler.

StatusCodeSelector

Gets or sets a delegate used to map an exception to a http status code.

Applies to