@budibase/backend-core 2.20.14 → 2.21.1
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/dist/index.js +6 -4
- package/dist/index.js.map +3 -3
- package/dist/index.js.meta.json +1 -1
- package/dist/package.json +4 -4
- package/dist/plugins.js.map +2 -2
- package/dist/plugins.js.meta.json +1 -1
- package/dist/src/middleware/errorHandling.js +11 -4
- package/dist/src/middleware/errorHandling.js.map +1 -1
- package/package.json +4 -4
- package/src/middleware/errorHandling.ts +9 -4
package/dist/index.js
CHANGED
|
@@ -65342,14 +65342,16 @@ async function errorHandling(ctx, next) {
|
|
|
65342
65342
|
} else {
|
|
65343
65343
|
console.error(err);
|
|
65344
65344
|
}
|
|
65345
|
-
|
|
65346
|
-
const body2 = {
|
|
65345
|
+
let error = {
|
|
65347
65346
|
message: err.message,
|
|
65348
65347
|
status,
|
|
65349
65348
|
validationErrors: err.validation,
|
|
65350
|
-
error
|
|
65349
|
+
error: getPublicError(err)
|
|
65351
65350
|
};
|
|
65352
|
-
ctx.
|
|
65351
|
+
if (environment_default.isTest() && ctx.headers["x-budibase-include-stacktrace"]) {
|
|
65352
|
+
error.stack = err.stack;
|
|
65353
|
+
}
|
|
65354
|
+
ctx.body = error;
|
|
65353
65355
|
}
|
|
65354
65356
|
}
|
|
65355
65357
|
var errorHandling_default = errorHandling;
|