qfetch
    Preparing search index...

    Type Alias RetryStatusOptions

    Configuration options for the withRetryStatus middleware.

    This middleware handles client-controlled retry timing. When a response has a retryable status code, the middleware uses the backoff strategy to determine wait times between attempts. Unlike withRetryAfter, this middleware ignores server timing directives and relies entirely on the configured strategy.

    type RetryStatusOptions = {
        retryableStatuses?: ReadonlySet<number>;
        strategy: () => BackoffStrategy;
    }
    Index

    Properties

    retryableStatuses?: ReadonlySet<number>

    Set of HTTP status codes that should trigger automatic retries.

    Defaults to the standard retryable status codes: 408, 429, 500, 502, 503, 504. Override to customize which status codes should be retried.

    new Set([408, 429, 500, 502, 503, 504])
    
    strategy: () => BackoffStrategy

    Factory function that creates a backoff strategy for retry delays.

    The strategy determines the delay between retry attempts and when to stop retrying (by returning NaN). Wrap with upto() to limit retry attempts.

    import { linear, upto } from "@proventuslabs/retry-strategies";

    strategy: () => upto(3, linear(1000, 10_000))