ErrorRecoveryConfig constructor

const ErrorRecoveryConfig({
  1. RecoveryAction onError(
    1. LocusError error,
    2. ErrorContext context
    )?,
  2. void onResolved(
    1. LocusError error,
    2. int attemptsTaken
    )?,
  3. void onExhausted(
    1. LocusError error
    )?,
  4. int maxRetries = 3,
  5. Duration retryDelay = const Duration(seconds: 5),
  6. double retryBackoff = 2.0,
  7. Duration maxRetryDelay = const Duration(minutes: 5),
  8. bool autoRestart = true,
  9. Set<LocusErrorType> autoRetryTypes = const {LocusErrorType.locationTimeout, LocusErrorType.networkError, LocusErrorType.serviceDisconnected},
  10. Set<LocusErrorType> ignoreTypes = const {},
  11. bool logErrors = true,
})

Creates an error recovery configuration.

Implementation

const ErrorRecoveryConfig({
  this.onError,
  this.onResolved,
  this.onExhausted,
  this.maxRetries = 3,
  this.retryDelay = const Duration(seconds: 5),
  this.retryBackoff = 2.0,
  this.maxRetryDelay = const Duration(minutes: 5),
  this.autoRestart = true,
  this.autoRetryTypes = const {
    LocusErrorType.locationTimeout,
    LocusErrorType.networkError,
    LocusErrorType.serviceDisconnected,
  },
  this.ignoreTypes = const {},
  this.logErrors = true,
});