ibm-cloud-sdk-core 5.4.3 → 5.4.4

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.
@@ -528,19 +528,21 @@ function hasStringProperty(obj, property) {
528
528
  */
529
529
  function parseServiceErrorMessage(response) {
530
530
  let message;
531
- if (Array.isArray(response.errors) &&
532
- response.errors.length > 0 &&
533
- hasStringProperty(response.errors[0], 'message')) {
534
- message = response.errors[0].message;
535
- }
536
- else if (hasStringProperty(response, 'error')) {
537
- message = response.error;
538
- }
539
- else if (hasStringProperty(response, 'message')) {
540
- message = response.message;
541
- }
542
- else if (hasStringProperty(response, 'errorMessage')) {
543
- message = response.errorMessage;
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;
@@ -627,19 +627,21 @@ function hasStringProperty(obj, property) {
627
627
  */
628
628
  function parseServiceErrorMessage(response) {
629
629
  var message;
630
- if (Array.isArray(response.errors) &&
631
- response.errors.length > 0 &&
632
- hasStringProperty(response.errors[0], 'message')) {
633
- message = response.errors[0].message;
634
- }
635
- else if (hasStringProperty(response, 'error')) {
636
- message = response.error;
637
- }
638
- else if (hasStringProperty(response, 'message')) {
639
- message = response.message;
640
- }
641
- else if (hasStringProperty(response, 'errorMessage')) {
642
- message = response.errorMessage;
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",
3
+ "version": "5.4.4",
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",