API 参考
    正在准备搜索索引...

    接口 IAxiosRetryConfig

    interface IAxiosRetryConfig {
        onMaxRetryTimesExceeded?: (
            error: AxiosError,
            retryCount: number,
        ) => void | Promise<void>;
        onRetry?: (
            retryCount: number,
            error: AxiosError,
            requestConfig: AxiosRequestConfig,
        ) => void | Promise<void>;
        retries?: number;
        retryCondition?: (error: AxiosError) => boolean | Promise<boolean>;
        retryDelay?: (retryCount: number, error: AxiosError) => number;
        shouldResetTimeout?: boolean;
        validateResponse?: ((response: AxiosResponse) => boolean) | null;
    }

    层级 (查看层级一览)

    索引
    onMaxRetryTimesExceeded?: (
        error: AxiosError,
        retryCount: number,
    ) => void | Promise<void>

    After all the retries are failed, this callback will be called with the last error before throwing the error.

    onRetry?: (
        retryCount: number,
        error: AxiosError,
        requestConfig: AxiosRequestConfig,
    ) => void | Promise<void>

    A callback to get notified when a retry occurs, the number of times it has occurred, and the error

    retries?: number

    The number of times to retry before failing default: 3

    retryCondition?: (error: AxiosError) => boolean | Promise<boolean>

    A callback to further control if a request should be retried. default: it retries if it is a network error or a 5xx error on an idempotent request (GET, HEAD, OPTIONS, PUT or DELETE).

    retryDelay?: (retryCount: number, error: AxiosError) => number

    A callback to further control the delay between retry requests. By default there is no delay.

    shouldResetTimeout?: boolean

    Defines if the timeout should be reset between retries default: false

    validateResponse?: ((response: AxiosResponse) => boolean) | null

    A callback to define whether a response should be resolved or rejected. If null is passed, it will fallback to the axios default (only 2xx status codes are resolved).