Comparing version 2.3.3 to 2.3.4
@@ -0,1 +1,6 @@ | ||
2.3.4 | ||
----- | ||
* Preserve errors for error responses - @jkrems | ||
https://github.com/groupon/gofer/pull/35 | ||
2.3.3 | ||
@@ -2,0 +7,0 @@ ----- |
@@ -221,7 +221,10 @@ // Generated by CoffeeScript 1.9.0 | ||
return this.hub.fetch(options, function(error, body, response, responseData) { | ||
var parseJSON, _ref3, _ref4; | ||
var parseError, parseJSON, _ref3, _ref4; | ||
parseJSON = (_ref3 = options.parseJSON) != null ? _ref3 : isJsonResponse(response, body); | ||
if (parseJSON) { | ||
_ref4 = safeParseJSON(body, response), error = _ref4.error, body = _ref4.body; | ||
_ref4 = safeParseJSON(body, response), parseError = _ref4.parseError, body = _ref4.body; | ||
} | ||
if (error == null) { | ||
error = parseError; | ||
} | ||
return cb(error, body, responseData, response); | ||
@@ -228,0 +231,0 @@ }); |
@@ -97,7 +97,10 @@ // Generated by CoffeeScript 1.9.0 | ||
handleResult = function(error, response, body) { | ||
var apiError, logLine, maxStatusCode, minStatusCode, parseJSON, successfulRequest, uri, _ref5, _ref6, _ref7; | ||
var apiError, logLine, maxStatusCode, minStatusCode, parseError, parseJSON, successfulRequest, uri, _ref5, _ref6, _ref7; | ||
parseJSON = (_ref5 = options.parseJSON) != null ? _ref5 : isJsonResponse(response, body); | ||
if (parseJSON) { | ||
_ref6 = safeParseJSON(body, response), error = _ref6.error, body = _ref6.body; | ||
_ref6 = safeParseJSON(body, response), parseError = _ref6.parseError, body = _ref6.body; | ||
} | ||
if (error == null) { | ||
error = parseError; | ||
} | ||
responseData.fetchDuration = getSeconds(); | ||
@@ -104,0 +107,0 @@ responseData.requestOptions.uri = this.uri; |
{ | ||
"name": "gofer", | ||
"version": "2.3.3", | ||
"version": "2.3.4", | ||
"description": "A general purpose service client library for node.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/gofer.js", |
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
58612
843