FallbackSyntax
Fluent API for defining a Fallback Policy.
Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, calls fallbackAction.
public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Action<CancellationToken> fallbackAction)
Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, calls fallbackAction.
public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Action fallbackAction, Action<Exception> onFallback)
Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, first calls onFallback with details of the handled exception; then calls fallbackAction.
public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Action<CancellationToken> fallbackAction, Action<Exception> onFallback)
Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, first calls onFallback with details of the handled exception; then calls fallbackAction.
public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Action<Context> fallbackAction, Action<Exception, Context> onFallback)
Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, first calls onFallback with details of the handled exception and the execution context; then calls fallbackAction.
public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Action<Context, CancellationToken> fallbackAction, Action<Exception, Context> onFallback)
Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, first calls onFallback with details of the handled exception and the execution context; then calls fallbackAction.
public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Action<Exception, Context, CancellationToken> fallbackAction, Action<Exception, Context> onFallback)
Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, first calls onFallback with details of the handled exception and the execution context; then calls fallbackAction.