Socket
Socket
Sign inDemoInstall

retry-axios

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retry-axios - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

4

build/src/index.d.ts

@@ -40,2 +40,6 @@ import { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';

shouldRetry?: (err: AxiosError) => boolean;
/**
* When there is no response, the number of retries to attempt. Defaults to 2.
*/
noResponseRetries?: number;
}

@@ -42,0 +46,0 @@ export declare type RaxConfig = {

@@ -37,2 +37,6 @@ "use strict";

config.httpMethodsToRetry || ['GET', 'HEAD', 'PUT', 'OPTIONS', 'DELETE'];
config.noResponseRetries = (config.noResponseRetries === undefined ||
config.noResponseRetries === null) ?
2 :
config.noResponseRetries;
// If this wasn't in the list of status codes where we want

@@ -86,2 +90,7 @@ // to automatically retry, return.

}
// Check if this error has no response (ETIMEDOUT, ENOTFOUND, etc)
if (!err.response &&
((config.currentRetryAttempt || 0) >= config.noResponseRetries)) {
return false;
}
// Only retry with configured HttpMethods.

@@ -88,0 +97,0 @@ if (!err.config.method ||

2

package.json
{
"name": "retry-axios",
"version": "0.2.0",
"version": "0.3.0",
"description": "Retry HTTP requests with Axios.",

@@ -5,0 +5,0 @@ "main": "./build/src/index.js",

@@ -52,5 +52,8 @@ # retry-axios

raxConfig: {
// Retry 3 times before giving up. Defaults to 3.
// Retry 3 times on requests that return a response (500, etc) before giving up. Defaults to 3.
retry: 3,
// Retry twice on errors that don't return a response (ENOTFOUND, ETIMEDOUT, etc).
noResponseRetries: 2,
// Milliseconds to delay at first. Defaults to 100.

@@ -57,0 +60,0 @@ retryDelay: 100,

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc