@trenskow/api-error 2.5.41 → 2.5.43
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/index.js +3 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -22,13 +22,12 @@ class ApiError extends Error {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
static parse(data, statusCode, origin
|
|
25
|
+
static parse(data, statusCode, origin) {
|
|
26
26
|
|
|
27
27
|
let options = merge({}, data, {
|
|
28
28
|
message: data.message,
|
|
29
29
|
statusCode: statusCode,
|
|
30
|
-
origin: origin
|
|
31
|
-
stack: stack
|
|
30
|
+
origin: origin
|
|
32
31
|
});
|
|
33
32
|
|
|
34
33
|
options.errors = options.errors?.map((error) => ApiError.parse(error, statusCode, origin, error.stack));
|
|
@@ -118,6 +117,7 @@ class ApiError extends Error {
|
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
get stacked() {
|
|
120
|
+
if (this.actual._stacked) return this.actual._stacked;
|
|
121
121
|
return ApiError.stackToJSON(this.actual.stack);
|
|
122
122
|
}
|
|
123
123
|
|