copyWith method

ErrorRecoveryConfig copyWith({
  1. RecoveryAction onError(
    1. LocusError,
    2. ErrorContext
    )?,
  2. void onResolved(
    1. LocusError,
    2. int
    )?,
  3. void onExhausted(
    1. LocusError
    )?,
  4. int? maxRetries,
  5. Duration? retryDelay,
  6. double? retryBackoff,
  7. Duration? maxRetryDelay,
  8. bool? autoRestart,
  9. Set<LocusErrorType>? autoRetryTypes,
  10. Set<LocusErrorType>? ignoreTypes,
  11. bool? logErrors,
})

Creates a copy with the given fields replaced.

Implementation

ErrorRecoveryConfig copyWith({
  RecoveryAction Function(LocusError, ErrorContext)? onError,
  void Function(LocusError, int)? onResolved,
  void Function(LocusError)? onExhausted,
  int? maxRetries,
  Duration? retryDelay,
  double? retryBackoff,
  Duration? maxRetryDelay,
  bool? autoRestart,
  Set<LocusErrorType>? autoRetryTypes,
  Set<LocusErrorType>? ignoreTypes,
  bool? logErrors,
}) {
  return ErrorRecoveryConfig(
    onError: onError ?? this.onError,
    onResolved: onResolved ?? this.onResolved,
    onExhausted: onExhausted ?? this.onExhausted,
    maxRetries: maxRetries ?? this.maxRetries,
    retryDelay: retryDelay ?? this.retryDelay,
    retryBackoff: retryBackoff ?? this.retryBackoff,
    maxRetryDelay: maxRetryDelay ?? this.maxRetryDelay,
    autoRestart: autoRestart ?? this.autoRestart,
    autoRetryTypes: autoRetryTypes ?? this.autoRetryTypes,
    ignoreTypes: ignoreTypes ?? this.ignoreTypes,
    logErrors: logErrors ?? this.logErrors,
  );
}