@datapos/datapos-shared 0.3.568 → 0.3.570

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.
@@ -5,14 +5,14 @@ class c extends Error {
5
5
  super(s, r), this.name = "DPUError", this.locator = o;
6
6
  }
7
7
  }
8
- class E extends c {
8
+ class d extends c {
9
9
  body;
10
10
  // Sanitized snapshot of the response body
11
11
  constructor(s, o, r, t) {
12
12
  super(s, o, t), this.name = "APIError", this.body = l(r ?? void 0);
13
13
  }
14
14
  }
15
- class d extends c {
15
+ class E extends c {
16
16
  constructor(s, o, r) {
17
17
  super(s, o, r), this.name = "EngineError";
18
18
  }
@@ -90,15 +90,12 @@ function h(e) {
90
90
  t = { body: void 0, locator: r.locator, message: r.message, name: "DPUError", stack: r.stack }, r = r.cause == null ? null : a(r.cause);
91
91
  break;
92
92
  }
93
- case "Error":
94
- console.log(7777, r), t = { body: void 0, locator: "", message: r.message, name: r.name, stack: r.stack }, r = r.cause == null ? null : a(r.cause);
95
- break;
96
93
  default:
97
- console.log(8888, r), t = { body: void 0, locator: "", message: g(r), name: "Error", stack: void 0 }, r = null;
94
+ r.name ? (t = { body: void 0, locator: "", message: r.message, name: r.name, stack: r.stack }, r = r.cause == null ? null : a(r.cause)) : (t = { body: void 0, locator: "", message: g(r), name: "Error", stack: void 0 }, r = null);
98
95
  }
99
96
  /(?:\.{3}|[.!?])$/.test(t.message) || (t.message += "."), o.push(t);
100
97
  }
101
- return console.log(4444, o), o;
98
+ return o;
102
99
  }
103
100
  function p(e) {
104
101
  if (e.length === 0) return;
@@ -107,13 +104,13 @@ function p(e) {
107
104
  let r;
108
105
  switch (o.name) {
109
106
  case "APIError":
110
- r = new E(o.message, o.locator, o.body, { cause: s });
107
+ r = new d(o.message, o.locator, o.body, { cause: s });
111
108
  break;
112
109
  case "ConnectorError":
113
110
  r = new m(o.message, o.locator, { cause: s });
114
111
  break;
115
112
  case "EngineError":
116
- r = new d(o.message, o.locator, { cause: s });
113
+ r = new E(o.message, o.locator, { cause: s });
117
114
  break;
118
115
  case "FetchError":
119
116
  r = new i(o.message, o.locator, o.body, { cause: s });
@@ -122,7 +119,7 @@ function p(e) {
122
119
  r = new c(o.message, o.locator, { cause: s });
123
120
  break;
124
121
  default:
125
- console.log(5555, o), r = new Error(o.message, { cause: s }), r.name = o.name;
122
+ r = new Error(o.message, { cause: s }), r.name = o.name;
126
123
  break;
127
124
  }
128
125
  o.stack !== void 0 && (r.stack = o.stack), s = r;
@@ -143,10 +140,10 @@ function l(e) {
143
140
  return e.length > 2048 ? `${e.slice(0, 2048)}... [truncated]` : e;
144
141
  }
145
142
  export {
146
- E as APIError,
143
+ d as APIError,
147
144
  m as ConnectorError,
148
145
  c as DPUError,
149
- d as EngineError,
146
+ E as EngineError,
150
147
  i as FetchError,
151
148
  y as buildFetchError,
152
149
  b as concatenateSerialisedErrorMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.568",
3
+ "version": "0.3.570",
4
4
  "description": "A library containing common constants, types and utilities used across all Data Positioning projects.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Terrell <terrell.jm@gmail.com>",