RetryContext class final

The information a RetryStrategy uses to decide whether—and how long after—a failed request should be retried.

A fresh RetryContext is produced for every failed attempt and handed to RetryStrategy.nextDelay.

Constructors

RetryContext({required int attempt, required RetryReason reason, required bool isProcedure, required bool isAmbiguous, String? nsid, int? statusCode, Object? error, Duration? retryAfter})
Returns the new instance of RetryContext.
const

Properties

attempt int
The number of attempts that have already failed, starting at 1 for the first failure. The initial request is attempt 1 once it fails, so the value handed to the strategy is always >= 1.
final
error Object?
The error that caused the failure, when one was thrown.
final
hashCode int
The hash code for this object.
no setterinherited
isAmbiguous bool
Whether the failure may have been observed by the server, so that retrying a non-idempotent request risks duplicating its side effect.
final
isProcedure bool
Whether the failed request was an XRPC procedure (a POST with side effects). Queries (GET) and subscriptions are not procedures.
final
isQuery bool
Whether the failed request was an XRPC query (a GET) or a subscription.
no setter
nsid String?
The lexicon method id (NSID) of the request, when known.
final
reason RetryReason
The normalized category of the failure.
final
retryAfter Duration?
The wait the server asked for via Retry-After / ratelimit-reset, already resolved to a Duration, when present.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int?
The HTTP status code of the response, when the failure carried one.
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