Closed iDVB closed 4 years ago
retryCondition: e => e.code === 429,
retryDelay: axiosRetry.exponentialBackoff
I recommend the following (in order to keep the default behaviour):
import axiosRetry, {isNetworkOrIdempotentRequestError} from 'axios-retry';
// ...
retryCondition: (error: AxiosError) => {
return isNetworkOrIdempotentRequestError(error) || error.code === 429;
},
I don't have an error.code, but if I have a response from the I have a error.response.status.
I got mine working like this:
axiosRetry(axiosInstance, { retries: 5, retryCondition: e => { return isNetworkOrIdempotentRequestError(e) || e.response.status === 429 }, retryDelay: axiosRetry.exponentialDelay });
Is there a way to retry with backoff for 429 only?