retry property

Retry? retry
final

The retry strategy to use when a provider fails.

The function takes two parameters:

  • retryCount: The number of times the provider has been retried (starting at 0).
  • error: The error that caused the retry.

The function takes two parameters:

  • retryCount: The number of times the provider has been retried (starting at 0).
  • error: The error that caused the retry.

The default implementation:

  • 10 retries
  • starts with a delay of 200ms
  • doubles the delay on each retry up to 6.4 seconds
  • retries all failures
  • ignores ProviderExceptions (which happens when a provider rethrows the error of another provider)
  • ignores Errors (which are generally programming errors)

To learn more about retry logic, see Automatic Retry.

Implementation

// Make sure to also update the website retry.mdx
/// The default implementation:
/// - 10 retries
/// - starts with a delay of 200ms
/// - doubles the delay on each retry up to 6.4 seconds
/// - retries all failures
/// - ignores [ProviderException]s (which happens when a provider
///   rethrows the error of another provider)
/// - ignores [Error]s (which are generally programming errors)
///
/// To learn more about retry logic, see [Automatic Retry](https://riverpod.dev/docs/concepts2/retry).
/// {@endtemplate}
final Retry? retry;