@budibase/backend-core 2.21.0 → 2.21.2

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 CHANGED
@@ -65342,14 +65342,16 @@ async function errorHandling(ctx, next) {
65342
65342
  } else {
65343
65343
  console.error(err);
65344
65344
  }
65345
- const error = getPublicError(err);
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.body = body2;
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;