retry-axios
retry-axios copied to clipboard
Include an `isFinalRetry` property
When chain this interceptor with another global interceptor that displays an error message, it would be helpful to easily know if this request is the final retry of rax.
Currently, the logic to determine if the current retry is the final one is kind of complicated because of retries
and noResponseRetries
Great idea! If we were to do this, I think I'd do something like a retriesRemaining
property.
Cool. I currently copied the whole shouldRetryRequest
method out to check if a request is the last retry. If we can simply expose the value of it, it should work, too.
was this feature added?
The property name is different, but the currentRetryAttempt
, which may be a good substitute.
https://github.com/JustinBeckwith/retry-axios/blob/main/src/index.ts#L21
We can access this property from config.raxConfig
of axios.
declare module 'axios' {
export interface AxiosRequestConfig {
raxConfig?: RetryConfig;
}
}