How to use the axios-retry.isNetworkError function in axios-retry

To help you get started, we’ve selected a few axios-retry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github segmentio / analytics-node / index.js View on Github external
_isErrorRetryable (error) {
    // Retry Network Errors.
    if (axiosRetry.isNetworkError(error)) {
      return true
    }

    if (!error.response) {
      // Cannot determine if the request can be retried
      return false
    }

    // Retry Server Errors (5xx).
    if (error.response.status >= 500 && error.response.status <= 599) {
      return true
    }

    // Retry if rate limited.
    if (error.response.status === 429) {
      return true
github vtex / node-vtex-api / src / utils / Retry.ts View on Github external
export const isNetworkErrorOrRouterTimeout = (e: any) => {
  if (isNetworkError(e)) {
    console.warn('Retry from network error', e.message)
    return true
  }

  if (e && e.response && e.response.data && e.response.data.code === TIMEOUT_CODE) {
    console.warn('Retry from timeout', e.message)
    return true
  }

  return false
}
github lifeomic / cli / lib / fhir.js View on Github external
const shouldRetry = error => {
  return axiosRetry.isNetworkError(error) ||
    axiosRetry.isRetryableError(error) ||
    error.code === 'ECONNABORTED' ||
    (error.response && error.response.status === 429);
};
const retryConfig = {

axios-retry

Axios plugin that intercepts failed requests and retries them whenever posible.

Apache-2.0
Latest version published 5 months ago

Package Health Score

80 / 100
Full package analysis

Similar packages