Type Alias ErrorRetryOptions

ErrorRetryOptions: {
    enableRetry?: boolean | ((config: XiorRequestConfig, error: XiorError) => boolean | undefined);
    onRetry?: ((config: XiorRequestConfig, error: XiorError, count: number) => void);
    retryInterval?: number | ((count: number, config: XiorInterceptorRequestConfig, error: XiorError) => number);
    retryTimes?: number;
}

Type declaration

  • OptionalenableRetry?: boolean | ((config: XiorRequestConfig, error: XiorError) => boolean | undefined)

    default: true, it's useful because we don't want retry when the error because of token expired

  • OptionalonRetry?: ((config: XiorRequestConfig, error: XiorError, count: number) => void)
      • (config, error, count): void
      • Parameters

        Returns void

  • OptionalretryInterval?: number | ((count: number, config: XiorInterceptorRequestConfig, error: XiorError) => number)

    Retry after milliseconds, default: 3000 after first time error retry, retry interval

  • OptionalretryTimes?: number

    retry times, default: 2