Share via


ExceptionHandlerExtensions.HandleAsync Method (IExceptionHandler, ExceptionContext, CancellationToken)

 

Calls an exception handler and determines the response handling it, if any.

Namespace:   System.Web.Http.ExceptionHandling
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

public static Task<HttpResponseMessage> HandleAsync(
    this IExceptionHandler handler,
    ExceptionContext context,
    CancellationToken cancellationToken
)
public:
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ HandleAsync(
    IExceptionHandler^ handler,
    ExceptionContext^ context,
    CancellationToken cancellationToken
)
static member HandleAsync : 
        handler:IExceptionHandler *
        context:ExceptionContext *
        cancellationToken:CancellationToken -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function HandleAsync (
    handler As IExceptionHandler,
    context As ExceptionContext,
    cancellationToken As CancellationToken
) As Task(Of HttpResponseMessage)

Parameters

Return Value

Type: System.Threading.Tasks.Task<HttpResponseMessage>

A task that, when completed, contains the response message to return when the exception is handled, or null when the exception remains unhandled.

See Also

ExceptionHandlerExtensions Class
System.Web.Http.ExceptionHandling Namespace

Return to top