@cloudtower/eagle 0.33.19 → 0.33.21

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.
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ var _ = require('lodash');
4
+
3
5
  const isResponseCTError = (error) => {
4
6
  return typeof error === "object" && error !== null && ("code" in error || "message" in error || "details" in error);
5
7
  };
@@ -11,9 +13,9 @@ const handleResponseCTError = (error) => {
11
13
  message: detail.message,
12
14
  params: detail.params
13
15
  }));
14
- } else if ("code" in error && typeof error.code === "string") {
16
+ } else if ("code" in error) {
15
17
  const code = error.code;
16
- if (code) {
18
+ if (!_.isNil(code)) {
17
19
  return [{ code, params: error.params }];
18
20
  }
19
21
  }