Language

ExceptionHandlerOptions.StatusCodeSelector Property

Definition

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

public Func<Exception,int>? StatusCodeSelector { get; set; }
member this.StatusCodeSelector : Func<Exception, int> with get, set
Public Property StatusCodeSelector As Func(Of Exception, Integer)

Property Value

Remarks

If StatusCodeSelector is null, the default exception status code is 500. If the exception is a BadHttpRequestException, its StatusCode is used instead.

Applies to