@naturalcycles/backend-lib 4.17.2 → 4.17.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.
|
@@ -53,6 +53,9 @@ function respondWithError(req, res, err) {
|
|
|
53
53
|
delete httpError.stack;
|
|
54
54
|
httpError.data.errorId = errorId;
|
|
55
55
|
httpError.data.backendResponseStatusCode ||= 500; // default to 500
|
|
56
|
+
// httpStatusCode is for backwards-compatibility
|
|
57
|
+
// Otherwise, it breaks the _isHttpErrorResponse function check, and error get formatted/detected wrongly
|
|
58
|
+
httpError.data['httpStatusCode'] = httpError.data.backendResponseStatusCode;
|
|
56
59
|
httpError.data.headersSent = headersSent || undefined;
|
|
57
60
|
httpError.data.report ||= undefined; // set to undefined if false
|
|
58
61
|
(0, js_lib_1._filterUndefinedValues)(httpError.data, true);
|
package/package.json
CHANGED
|
@@ -86,6 +86,9 @@ export function respondWithError(req: BackendRequest, res: BackendResponse, err:
|
|
|
86
86
|
|
|
87
87
|
httpError.data.errorId = errorId
|
|
88
88
|
httpError.data.backendResponseStatusCode ||= 500 // default to 500
|
|
89
|
+
// httpStatusCode is for backwards-compatibility
|
|
90
|
+
// Otherwise, it breaks the _isHttpErrorResponse function check, and error get formatted/detected wrongly
|
|
91
|
+
httpError.data['httpStatusCode'] = httpError.data.backendResponseStatusCode
|
|
89
92
|
httpError.data.headersSent = headersSent || undefined
|
|
90
93
|
httpError.data.report ||= undefined // set to undefined if false
|
|
91
94
|
_filterUndefinedValues(httpError.data, true)
|