Class DomainExceptionHandlingBehaviour<TMessage>
Catches IDomainException and logs them as warnings, preventing them from triggering MassTransit's retry policies.
Implements
IPipelineBehavior<TMessage>
Inherited Members
Namespace: Chapar.Pipeline.Behaviours
Assembly: Chapar.Pipeline.dll
Syntax
public class DomainExceptionHandlingBehaviour<TMessage> : IPipelineBehavior<TMessage> where TMessage : IMessage
Type Parameters
| Name | Description |
|---|---|
| TMessage |
Constructors
| Edit this page View SourceDomainExceptionHandlingBehaviour(ILogger<DomainExceptionHandlingBehaviour<TMessage>>)
Declaration
public DomainExceptionHandlingBehaviour(ILogger<DomainExceptionHandlingBehaviour<TMessage>> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger<DomainExceptionHandlingBehaviour<TMessage>> | logger |
Methods
| Edit this page View SourceHandleAsync(TMessage, Func<Task>, CancellationToken)
Executes the behaviour and optionally calls the next delegate in the pipeline.
Declaration
public Task HandleAsync(TMessage message, Func<Task> next, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| TMessage | message | The message to process. |
| Func<Task> | next | A delegate representing the next action in the pipeline. |
| CancellationToken | cancellationToken | Token to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task |