ibm-cloud-sdk-core 5.4.3 → 5.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/lib/request-wrapper.js +15 -13
- package/lib/request-wrapper.js +15 -13
- package/package.json +3 -3
|
@@ -528,19 +528,21 @@ function hasStringProperty(obj, property) {
|
|
|
528
528
|
*/
|
|
529
529
|
function parseServiceErrorMessage(response) {
|
|
530
530
|
let message;
|
|
531
|
-
if (
|
|
532
|
-
response.errors
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
531
|
+
if (response) {
|
|
532
|
+
if (Array.isArray(response.errors) &&
|
|
533
|
+
response.errors.length > 0 &&
|
|
534
|
+
hasStringProperty(response.errors[0], 'message')) {
|
|
535
|
+
message = response.errors[0].message;
|
|
536
|
+
}
|
|
537
|
+
else if (hasStringProperty(response, 'error')) {
|
|
538
|
+
message = response.error;
|
|
539
|
+
}
|
|
540
|
+
else if (hasStringProperty(response, 'message')) {
|
|
541
|
+
message = response.message;
|
|
542
|
+
}
|
|
543
|
+
else if (hasStringProperty(response, 'errorMessage')) {
|
|
544
|
+
message = response.errorMessage;
|
|
545
|
+
}
|
|
544
546
|
}
|
|
545
547
|
logger.info(`Parsing service error message: ${message}`);
|
|
546
548
|
return message;
|
package/lib/request-wrapper.js
CHANGED
|
@@ -627,19 +627,21 @@ function hasStringProperty(obj, property) {
|
|
|
627
627
|
*/
|
|
628
628
|
function parseServiceErrorMessage(response) {
|
|
629
629
|
var message;
|
|
630
|
-
if (
|
|
631
|
-
response.errors
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
630
|
+
if (response) {
|
|
631
|
+
if (Array.isArray(response.errors) &&
|
|
632
|
+
response.errors.length > 0 &&
|
|
633
|
+
hasStringProperty(response.errors[0], 'message')) {
|
|
634
|
+
message = response.errors[0].message;
|
|
635
|
+
}
|
|
636
|
+
else if (hasStringProperty(response, 'error')) {
|
|
637
|
+
message = response.error;
|
|
638
|
+
}
|
|
639
|
+
else if (hasStringProperty(response, 'message')) {
|
|
640
|
+
message = response.message;
|
|
641
|
+
}
|
|
642
|
+
else if (hasStringProperty(response, 'errorMessage')) {
|
|
643
|
+
message = response.errorMessage;
|
|
644
|
+
}
|
|
643
645
|
}
|
|
644
646
|
logger_1.default.info("Parsing service error message: ".concat(message));
|
|
645
647
|
return message;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ibm-cloud-sdk-core",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.5",
|
|
4
4
|
"description": "Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"typings": "./es/index.d.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"file-type": "16.5.4",
|
|
46
46
|
"form-data": "^4.0.4",
|
|
47
47
|
"isstream": "0.1.2",
|
|
48
|
-
"jsonwebtoken": "^9.0.
|
|
48
|
+
"jsonwebtoken": "^9.0.3",
|
|
49
49
|
"mime-types": "2.1.35",
|
|
50
50
|
"retry-axios": "^2.6.0",
|
|
51
51
|
"tough-cookie": "^4.1.3"
|
|
@@ -58,6 +58,6 @@
|
|
|
58
58
|
"./auth/utils/read-credentials-file": "./auth/utils/read-credentials-file.browser"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
|
-
"node": ">=
|
|
61
|
+
"node": ">=20"
|
|
62
62
|
}
|
|
63
63
|
}
|