Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
retryCondition: err =>
(axiosRetry.isNetworkOrIdempotentRequestError(err) ||
(err.response.status >= 400 && err.response.status < 500))
}
export const isNetworkErrorOrRouterTimeout = (e: any) => {
if (isNetworkOrIdempotentRequestError(e)) {
printLabel(e, 'Retry from network error')
return true
}
if (e && isSafeRequestError(e) && e.response && e.response.data && e.response.data.code === TIMEOUT_CODE) {
printLabel(e, 'Retry from timeout')
return true
}
return false
}