Table of Contents

Class RequestExceptionProcessorBehavior<TRequest, TResponse>

Namespace
Caesar.Pipeline
Assembly
Caesar.dll

Catches exceptions from the inner pipeline and dispatches them to the matching IRequestExceptionHandler<TRequest, TResponse, TException> instances, most specific exception type first. If a handler marks the exception as handled, its response is returned; otherwise the exception is rethrown with its original stack trace.

public sealed class RequestExceptionProcessorBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : notnull

Type Parameters

TRequest

The request type.

TResponse

The response type.

Inheritance
RequestExceptionProcessorBehavior<TRequest, TResponse>
Implements
IPipelineBehavior<TRequest, TResponse>
Inherited Members

Constructors

RequestExceptionProcessorBehavior(IServiceProvider)

Creates the behavior.

public RequestExceptionProcessorBehavior(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

Provider used to resolve exception handlers.

Methods

Handle(TRequest, RequestHandlerDelegate<TResponse>, CancellationToken)

Handles the request, calling next to continue the pipeline.

public Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken)

Parameters

request TRequest

The request.

next RequestHandlerDelegate<TResponse>

Continues the pipeline. Not calling it short-circuits the request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TResponse>