Table of Contents

Interface IRequestExceptionHandler<TRequest, TResponse, TException>

Namespace
Caesar.Pipeline
Assembly
Caesar.Abstractions.dll

Handles an exception of type TException (or a derived type) thrown while handling TRequest. Call SetHandled(TResponse) to swallow the exception and supply a fallback response; otherwise the exception is rethrown.

public interface IRequestExceptionHandler<in TRequest, TResponse, in TException> where TRequest : notnull where TException : Exception

Type Parameters

TRequest

The request type.

TResponse

The response type.

TException

The exception type.

Methods

Handle(TRequest, TException, RequestExceptionHandlerState<TResponse>, CancellationToken)

Handles the exception.

Task Handle(TRequest request, TException exception, RequestExceptionHandlerState<TResponse> state, CancellationToken cancellationToken)

Parameters

request TRequest

The request that failed.

exception TException

The exception.

state RequestExceptionHandlerState<TResponse>

State used to mark the exception as handled and provide a response.

cancellationToken CancellationToken

Cancellation token.

Returns

Task