nodecommons-rest
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -84,3 +84,3 @@ "use strict"; | ||
if (res.statusCode >= 400) { | ||
reject(buffer); | ||
reject({ code: res.statusCode, message: buffer.toString() }); | ||
return; | ||
@@ -107,13 +107,7 @@ } | ||
try { | ||
let json; | ||
try { | ||
json = JSON.parse(concat); | ||
} | ||
catch (e) { | ||
json = undefined; | ||
} | ||
reject(json); | ||
const json = JSON.parse(concat); | ||
reject({ code: res.statusCode, message: json }); | ||
} | ||
catch (e) { | ||
reject(concat); | ||
reject({ code: res.statusCode, message: concat }); | ||
} | ||
@@ -183,6 +177,6 @@ return; | ||
const json = JSON.parse(data); | ||
reject(json); | ||
reject({ code: res.statusCode, message: json }); | ||
} | ||
catch (e) { | ||
reject(data); | ||
reject({ code: res.statusCode, message: data }); | ||
} | ||
@@ -189,0 +183,0 @@ return; |
{ | ||
"name": "nodecommons-rest", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "", | ||
@@ -17,3 +17,3 @@ "scripts": { | ||
"nodecommons-url": "^1.1.2", | ||
"tscommons-core": "^1.0.25" | ||
"tscommons-core": "^1.1.0" | ||
}, | ||
@@ -20,0 +20,0 @@ "files": [ |
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
49676
725
Updatedtscommons-core@^1.1.0