eh-api-client
Advanced tools
Comparing version 0.20.0 to 0.21.0
var | ||
Q = require("q"), | ||
request = require("request"), | ||
_ = require("lodash"); | ||
_ = require("lodash"), | ||
debuglog = require("util").debuglog("eh-api-client"); | ||
@@ -96,2 +97,3 @@ var methods = [ | ||
} | ||
debuglog("Client.request", method, options, body); | ||
if(method === "GET" && typeof body === "object") { | ||
@@ -155,2 +157,4 @@ // body is options for GET request | ||
_res = res; | ||
debuglog("Client.request complete", method, options); | ||
debuglog("Client.request response error", err); | ||
if(err) { | ||
@@ -177,2 +181,3 @@ return deferred.reject(buildNetworkError(res, err, reqParams.url, method)); | ||
Client.prototype._tryRequest = function(params, numTry, cb) { | ||
debuglog("Request(" + numTry + "): ", params); | ||
var retryOptions = this._factory.retryOptions; | ||
@@ -183,4 +188,6 @@ var self = this; | ||
if(err && retryOptions) { | ||
debuglog("Request got an error ", err); | ||
numTry++; | ||
if(numTry >= retryOptions.maxAttempts || !retryOptions.retryStrategy(err)) { | ||
debuglog("Too much attempts with", err); | ||
err.retryInfo = { | ||
@@ -187,0 +194,0 @@ try: numTry |
{ | ||
"name": "eh-api-client", | ||
"version": "0.20.0", | ||
"version": "0.21.0", | ||
"description": "Node.js rest client", | ||
@@ -13,2 +13,5 @@ "main": "index.js", | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org/" | ||
}, | ||
"author": "calibr <awcalibr@gmail.com>", | ||
@@ -15,0 +18,0 @@ "license": "ISC", |
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
24525
838