Interface IErrorPolicyImplementation
An error policy is used to handle errors that may occur while processing the inbound messages.
Namespace: Silverback.Messaging.Inbound.ErrorHandling
Assembly: Silverback.Integration.dll
Syntax
public interface IErrorPolicyImplementation
Methods
| Improve this doc View sourceCanHandle(ConsumerPipelineContext, Exception)
Returns a boolean value indicating whether the policy can handle the specified envelopes and the specified exception.
Declaration
bool CanHandle(ConsumerPipelineContext context, Exception exception)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsumerPipelineContext | context | The ConsumerPipelineContext related to the message that failed to be processed. |
| Exception | exception | The exception that was thrown during the processing. |
Returns
| Type | Description |
|---|---|
| bool | A value indicating whether the specified envelopes and exception can be handled. |
HandleErrorAsync(ConsumerPipelineContext, Exception)
Performs the necessary actions to handle the error (including invoking the IConsumerTransactionManager).
Declaration
Task<bool> HandleErrorAsync(ConsumerPipelineContext context, Exception exception)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsumerPipelineContext | context | The ConsumerPipelineContext related to the message that failed to be processed. |
| Exception | exception | The exception that was thrown during the processing. |
Returns
| Type | Description |
|---|---|
| Task<bool> | A Task<TResult> representing the asynchronous operation. The task result contains a
boolean flag indicating whether the error was handled. If |