API 参考 / @142vip/axios / IAxiosRetryConfig
接口: IAxiosRetryConfig
定义于: node_modules/.pnpm/axios-retry@4.5.0_axios@1.17.0/node_modules/axios-retry/dist/cjs/index.d.ts:2
属性
onMaxRetryTimesExceeded?
optionalonMaxRetryTimesExceeded?: (error,retryCount) =>void|Promise<void>
定义于: node_modules/.pnpm/axios-retry@4.5.0_axios@1.17.0/node_modules/axios-retry/dist/cjs/index.d.ts:30
After all the retries are failed, this callback will be called with the last error before throwing the error.
参数
error
retryCount
number
返回
void | Promise<void>
onRetry?
optionalonRetry?: (retryCount,error,requestConfig) =>void|Promise<void>
定义于: node_modules/.pnpm/axios-retry@4.5.0_axios@1.17.0/node_modules/axios-retry/dist/cjs/index.d.ts:25
A callback to get notified when a retry occurs, the number of times it has occurred, and the error
参数
retryCount
number
error
requestConfig
返回
void | Promise<void>
retries?
optionalretries?:number
定义于: node_modules/.pnpm/axios-retry@4.5.0_axios@1.17.0/node_modules/axios-retry/dist/cjs/index.d.ts:7
The number of times to retry before failing default: 3
retryCondition?
optionalretryCondition?: (error) =>boolean|Promise<boolean>
定义于: node_modules/.pnpm/axios-retry@4.5.0_axios@1.17.0/node_modules/axios-retry/dist/cjs/index.d.ts:17
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).
参数
error
返回
boolean | Promise<boolean>
retryDelay?
optionalretryDelay?: (retryCount,error) =>number
定义于: node_modules/.pnpm/axios-retry@4.5.0_axios@1.17.0/node_modules/axios-retry/dist/cjs/index.d.ts:21
A callback to further control the delay between retry requests. By default there is no delay.
参数
retryCount
number
error
返回
number
shouldResetTimeout?
optionalshouldResetTimeout?:boolean
定义于: node_modules/.pnpm/axios-retry@4.5.0_axios@1.17.0/node_modules/axios-retry/dist/cjs/index.d.ts:12
Defines if the timeout should be reset between retries default: false
validateResponse?
optionalvalidateResponse?: ((response) =>boolean) |null
定义于: node_modules/.pnpm/axios-retry@4.5.0_axios@1.17.0/node_modules/axios-retry/dist/cjs/index.d.ts:35
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).