AniLink - v3.0.0
    Preparing search index...

    Function getRetryDelay

    • Computes the delay before the next retry, or null when the request should not be retried. Retry-After delays are returned un-jittered because the server dictates them.

      The retry matrix is explicit per error class:

      • AniLinkGraphQLError (a subclass of AniLinkApiError thrown from a 200 envelope) retries only when its upstream status is retryable (429 or a retryOnStatus code extracted from the GraphQL error entry). A GraphQL error with no upstream status (envelope default 200) is not retried, because it represents a permanent query/validation failure, not a transient transport condition. A GraphQL 429's delay comes from the error's own rateLimit.reset metadata (the envelope's x-ratelimit-reset header): the raw thrown value is the error itself, so no Axios error carries a Retry-After header to read.
      • AniLinkApiError (HTTP-level) retries on 429 (honoring Retry-After, or the error's rateLimit.reset metadata when the header is absent) and on any retryOnStatus code.
      • AniLinkNetworkError retries on network/timeout failures when retryOnNetworkError is set, but never on ABORTED.
      • AniLinkAuthError and AniLinkValidationError are never retried.

      Parameters

      • error: AniLinkError

        The normalized failure for the attempt.

      • rawError: unknown

        The raw thrown value, for Retry-After extraction.

      • attempt: number

        The zero-based index of the attempt that just failed.

      • policy: RetryPolicy

        The active retry policy.

      Returns number | null

      The delay to wait in milliseconds, or null when the failure must not be retried.