<PackageReference Include="Polly" Version="6.0.1" />

FallbackSyntaxAsync

public static class FallbackSyntaxAsync
Fluent API for defining a Fallback Policy.
public static FallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Func<CancellationToken, Task> fallbackAction)

Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception, asynchronously calls fallbackAction.

public static FallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Func<CancellationToken, Task> fallbackAction, Func<Exception, Task> onFallbackAsync)

Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception, first asynchronously calls onFallbackAsync with details of the handled exception; then asynchronously calls fallbackAction.

public static FallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Func<Context, CancellationToken, Task> fallbackAction, Func<Exception, Context, Task> onFallbackAsync)

Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception, first asynchronously calls onFallbackAsync with details of the handled exception and execution context; then asynchronously calls fallbackAction.

public static FallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Func<Exception, Context, CancellationToken, Task> fallbackAction, Func<Exception, Context, Task> onFallbackAsync)

Builds a FallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception, first asynchronously calls onFallbackAsync with details of the handled exception and execution context; then asynchronously calls fallbackAction.