DatumErrorRecoveryStrategy class

Defines a strategy for how the sync engine should behave on errors.

Constructors

DatumErrorRecoveryStrategy({required Future<bool> shouldRetry(DatumException error), int maxRetries = 3, DatumBackoffStrategy backoffStrategy = const ExponentialBackoff(), Future<void> onError(DatumException error)?})
Creates an error recovery strategy.
const

Properties

backoffStrategy DatumBackoffStrategy
The strategy for calculating the delay between retries.
final
hashCode int
The hash code for this object.
no setterinherited
maxRetries int
The maximum number of times to retry a failed operation.
final
onError Future<void> Function(DatumException error)?
An optional callback invoked when an error occurs that will not be retried, or after all retries have been exhausted. This is useful for logging or triggering alerts for persistent failures.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldRetry Future<bool> Function(DatumException error)
A function that determines if a given error should trigger a retry.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited