Comparing version 1.0.5 to 1.0.6
@@ -69,2 +69,3 @@ "use strict"; | ||
HTTP_STATUS_CODES = { | ||
NO_CONTENT: 204, | ||
PROXY_REQUIRED: 305, | ||
@@ -431,5 +432,6 @@ REDIRECT_CODE_PERM: 301, | ||
error = state.statusCode >= DEFAULTS.HTTP_ERROR_CODE_THRESHHOLD, | ||
retry = state.statusCode >= DEFAULTS.HTTP_ERROR_CODE_RETRY_THRESHHOLD && state.tries <= options.maxRetryCount; | ||
retry = state.statusCode >= DEFAULTS.HTTP_ERROR_CODE_RETRY_THRESHHOLD && state.tries <= options.maxRetryCount, | ||
statusCode = response.statusCode; | ||
if (json) { | ||
if (json && statusCode !== HTTP_STATUS_CODES.NO_CONTENT && body.length) { | ||
try { | ||
@@ -466,2 +468,3 @@ body = JSON.parse(body); | ||
_err5.state = state; | ||
_err5.statusCode = statusCode; | ||
return reject(_err5); | ||
@@ -468,0 +471,0 @@ } |
@@ -0,1 +1,6 @@ | ||
# v1.0.6 - 03/05/2019 | ||
* Added statusCode property from response to error when available | ||
* Fixed issue where 204 (no content) or an empty body caused parsing to fail | ||
# v1.0.5 - 02/28/2019 | ||
@@ -2,0 +7,0 @@ |
{ | ||
"name": "reqlib", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "A library to simplify REST API requests and to provide utilities for handling common REST API consumer scenarios ", | ||
@@ -5,0 +5,0 @@ "main": "dist", |
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
81918
798