Show / Hide Table of Contents

    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 source

    CanHandle(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.

    | Improve this doc View source

    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 false is returned the exception will be rethrown and the consumer will stop.

    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini