balena-request
Advanced tools
Comparing version 11.5.2 to 11.5.3-move-response-body-error-to-response-body-message-if-there-is-one-344ccfec2a0066249cbf4285aef1ef3f505314c9
@@ -118,2 +118,8 @@ "use strict"; | ||
} | ||
if (response.body != null && typeof response.body === 'object') { | ||
const bodyMessageProp = ['message', 'error'].find((prop) => typeof response.body[prop] === 'string'); | ||
if (bodyMessageProp != null) { | ||
return response.body[bodyMessageProp]; | ||
} | ||
} | ||
return response.body; | ||
@@ -120,0 +126,0 @@ } |
@@ -7,2 +7,7 @@ # Change Log | ||
# v11.5.3 | ||
## (2022-04-04) | ||
* Use response error as response message if there is one [Matthew Yarmolinsky] | ||
# v11.5.2 | ||
@@ -9,0 +14,0 @@ ## (2022-04-04) |
@@ -121,2 +121,11 @@ /* | ||
if (response.body != null && typeof response.body === 'object') { | ||
const bodyMessageProp = ['message', 'error'].find( | ||
(prop) => typeof response.body[prop] === 'string', | ||
); | ||
if (bodyMessageProp != null) { | ||
return response.body[bodyMessageProp]; | ||
} | ||
} | ||
return response.body; | ||
@@ -123,0 +132,0 @@ } |
{ | ||
"name": "balena-request", | ||
"version": "11.5.2", | ||
"version": "11.5.3-move-response-body-error-to-response-body-message-if-there-is-one-344ccfec2a0066249cbf4285aef1ef3f505314c9", | ||
"description": "Balena HTTP client", | ||
@@ -74,4 +74,4 @@ "main": "build/request.js", | ||
"versionist": { | ||
"publishedAt": "2022-04-04T13:22:18.304Z" | ||
"publishedAt": "2022-04-04T15:34:58.356Z" | ||
} | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
201014
3982
1