retry-axios
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -10,3 +10,3 @@ import axios, { isCancel, } from 'axios'; | ||
instance = instance || axios; | ||
return instance.interceptors.response.use(onFulfilled, onError); | ||
return instance.interceptors.response.use(onFulfilled, async (error) => onError(instance, error)); | ||
} | ||
@@ -76,3 +76,3 @@ /** | ||
} | ||
async function onError(error) { | ||
async function onError(instance, error) { | ||
if (isCancel(error)) { | ||
@@ -86,3 +86,3 @@ throw error; | ||
typeof config.retryDelay === 'number' ? config.retryDelay : 100; | ||
config.instance = config.instance || axios; | ||
config.instance = config.instance || instance; | ||
config.backoffType = config.backoffType || 'exponential'; | ||
@@ -89,0 +89,0 @@ config.httpMethodsToRetry = normalizeArray(config.httpMethodsToRetry) || [ |
{ | ||
"name": "retry-axios", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Retry HTTP requests with Axios.", | ||
@@ -37,3 +37,3 @@ "exports": "./build/src/index.js", | ||
"@types/node": "^20.0.0", | ||
"@types/sinon": "^10.0.13", | ||
"@types/sinon": "^17.0.0", | ||
"axios": "^1.2.1", | ||
@@ -40,0 +40,0 @@ "c8": "^8.0.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36295