copyWith method
- RecoveryAction onError()?,
- void onResolved()?,
- void onExhausted()?,
- int? maxRetries,
- Duration? retryDelay,
- double? retryBackoff,
- Duration? maxRetryDelay,
- bool? autoRestart,
- Set<
LocusErrorType> ? autoRetryTypes, - Set<
LocusErrorType> ? ignoreTypes, - 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,
);
}