Comparing version 1.2.20 to 1.2.21
@@ -113,3 +113,3 @@ 'use strict'; | ||
if (!response.ok) { | ||
var error = new Error(uri + ': ' + response.statusText); | ||
var error = new Error(uri + ': ' + response.status + ' ' + response.statusText); | ||
error.response = response; | ||
@@ -116,0 +116,0 @@ |
@@ -39,3 +39,3 @@ 'use strict'; | ||
var retries = 3; | ||
var retryDelay = 1000; | ||
var retryDelay = 500; | ||
@@ -55,6 +55,6 @@ if (options && options.retries) { | ||
}).catch(function (error) { | ||
if (n > 0) { | ||
if (n <= retries) { | ||
setTimeout(function () { | ||
wrappedFetch(--n); | ||
}, retryDelay); | ||
wrappedFetch(n + 1); | ||
}, retryDelay * Math.pow(2, n)); | ||
} else { | ||
@@ -65,3 +65,3 @@ reject(error); | ||
}; | ||
wrappedFetch(retries); | ||
wrappedFetch(0); | ||
}); | ||
@@ -68,0 +68,0 @@ } |
{ | ||
"name": "kongfig", | ||
"version": "1.2.20", | ||
"version": "1.2.21", | ||
"description": "A tool for Kong to allow declarative configuration.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/mybuilder/kongfig", |
211507