Show / Hide Table of Contents

    Class ErrorPolicyBase

    Builds the error policy.

    Inheritance
    object
    ErrorPolicyBase
    MoveMessageErrorPolicy
    RetryErrorPolicy
    SkipMessageErrorPolicy
    StopConsumerErrorPolicy
    Implements
    IErrorPolicy
    IEquatable<ErrorPolicyBase>
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    Namespace: Silverback.Messaging.Consuming.ErrorHandling
    Assembly: Silverback.Integration.dll
    Syntax
    public abstract record ErrorPolicyBase : IErrorPolicy, IEquatable<ErrorPolicyBase>

    Constructors

    ErrorPolicyBase()

    Builds the error policy.

    Declaration
    protected ErrorPolicyBase()

    ErrorPolicyBase(ErrorPolicyBase)

    Builds the error policy.

    Declaration
    protected ErrorPolicyBase(ErrorPolicyBase original)
    Parameters
    Type Name Description
    ErrorPolicyBase original

    Properties

    ApplyRule

    Gets the custom apply rule function.

    Declaration
    public Func<IRawInboundEnvelope, Exception, bool>? ApplyRule { get; init; }
    Property Value
    Type Description
    Func<IRawInboundEnvelope, Exception, bool>

    EqualityContract

    Builds the error policy.

    Declaration
    protected virtual Type EqualityContract { get; }
    Property Value
    Type Description
    Type

    ExcludedExceptions

    Gets the collection of exception types this policy doesn't have to be applied to.

    Declaration
    public IReadOnlyCollection<Type> ExcludedExceptions { get; init; }
    Property Value
    Type Description
    IReadOnlyCollection<Type>

    IncludedExceptions

    Gets the collection of exception types this policy have to be applied to.

    Declaration
    public IReadOnlyCollection<Type> IncludedExceptions { get; init; }
    Property Value
    Type Description
    IReadOnlyCollection<Type>

    MaxFailedAttempts

    Gets the number of times this policy should be applied to the same message in case of multiple failed attempts.

    Declaration
    public int? MaxFailedAttempts { get; }
    Property Value
    Type Description
    int?

    MessageToPublishFactory

    Gets the factory that builds the message to be published after the policy is applied.

    Declaration
    public Func<IRawInboundEnvelope, Exception, object?>? MessageToPublishFactory { get; init; }
    Property Value
    Type Description
    Func<IRawInboundEnvelope, Exception, object>

    Methods

    Build(IServiceProvider)

    Returns the actual error policy implementation, built using the provided IServiceProvider.

    Declaration
    public IErrorPolicyImplementation Build(IServiceProvider serviceProvider)
    Parameters
    Type Name Description
    IServiceProvider serviceProvider

    The IServiceProvider to be used to build the error policy.

    Returns
    Type Description
    IErrorPolicyImplementation

    An instance of IErrorPolicyImplementation that can be used to handle the processing error.

    BuildCore(IServiceProvider)

    Returns the actual error policy implementation, built using the provided IServiceProvider.

    Declaration
    protected abstract ErrorPolicyImplementation BuildCore(IServiceProvider serviceProvider)
    Parameters
    Type Name Description
    IServiceProvider serviceProvider

    The IServiceProvider to be used to build the error policy.

    Returns
    Type Description
    ErrorPolicyImplementation

    An instance of IErrorPolicyImplementation that can be used to handle the processing error.

    Equals(ErrorPolicyBase?)

    Builds the error policy.

    Declaration
    public virtual bool Equals(ErrorPolicyBase? other)
    Parameters
    Type Name Description
    ErrorPolicyBase other
    Returns
    Type Description
    bool

    Equals(object?)

    Builds the error policy.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)

    GetHashCode()

    Builds the error policy.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()

    PrintMembers(StringBuilder)

    Builds the error policy.

    Declaration
    protected virtual bool PrintMembers(StringBuilder builder)
    Parameters
    Type Name Description
    StringBuilder builder
    Returns
    Type Description
    bool

    ToString()

    Builds the error policy.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Operators

    operator ==(ErrorPolicyBase?, ErrorPolicyBase?)

    Builds the error policy.

    Declaration
    public static bool operator ==(ErrorPolicyBase? left, ErrorPolicyBase? right)
    Parameters
    Type Name Description
    ErrorPolicyBase left
    ErrorPolicyBase right
    Returns
    Type Description
    bool

    operator !=(ErrorPolicyBase?, ErrorPolicyBase?)

    Builds the error policy.

    Declaration
    public static bool operator !=(ErrorPolicyBase? left, ErrorPolicyBase? right)
    Parameters
    Type Name Description
    ErrorPolicyBase left
    ErrorPolicyBase right
    Returns
    Type Description
    bool

    Implements

    IErrorPolicy
    IEquatable<T>
    GitHub E-Mail
    ↑ Back to top © 2026 Sergio Aquilini