openshift-rest-client
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -48,12 +48,14 @@ 'use strict'; | ||
const buildError = (body) => { | ||
const err = new Error(body.message); | ||
err.statusCode = body.code; | ||
return err; | ||
}; | ||
request(req, (err, resp, body) => { | ||
if (err) { | ||
const err = new Error(body); | ||
err.statusCode = resp.statusCode; | ||
return reject(err); | ||
} | ||
if (err) return buildError(body); | ||
// Need to reject on unauthorized and errors that are not 404 | ||
if (resp.statusCode > 399 && resp.statusCode !== 404) { | ||
return reject(body); | ||
return reject(buildError(body)); | ||
} | ||
@@ -60,0 +62,0 @@ |
{ | ||
"name": "openshift-rest-client", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "Node.js client for developing with OpenShift", | ||
@@ -5,0 +5,0 @@ "main": "index.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
43665
868