ErrorRecoveryManager class

Manages error recovery strategies, fallbacks, and retry logic for relay operations.

Constructors

ErrorRecoveryManager({required NostrLogger logger})
Manages error recovery strategies, fallbacks, and retry logic for relay operations.

Properties

hashCode int
The hash code for this object.
no setterinherited
logger NostrLogger
final
recoveryStrategy ErrorRecoveryStrategy
Get the current recovery strategy.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearErrorHistory() → void
Clear error history.
dispose() → void
Dispose resources.
getCircuitBreakerState(String relayUrl) CircuitBreakerState
Implement circuit breaker pattern for a relay.
getErrorSummary({required String relayUrl}) ErrorSummary
Get error summary for diagnostics.
getFallbackRelay({required String primaryRelayUrl, required List<String> availableRelays}) String?
Get fallback relay (healthy alternative relay).
handleConnectionError({required String relayUrl, required dynamic error, required int attemptNumber, required Future<bool> retryFn()}) Future<bool>
Handle a relay connection error with recovery attempt.
handleTimeoutError({required String relayUrl, required int attemptNumber, required Future<bool> retryFn()}) Future<bool>
Handle an operation timeout error.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setRecoveryStrategy(ErrorRecoveryStrategy strategy) → void
Set a custom recovery strategy.
toString() String
A string representation of this object.
inherited

Operators

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

Constants

maxErrorHistorySize → const int
Maximum error history size.