@punks/backend-entity-manager 0.0.163 → 0.0.164

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/cjs/index.js CHANGED
@@ -22555,8 +22555,24 @@ class AppExceptionsFilterBase {
22555
22555
  statusCode: status,
22556
22556
  timestamp: new Date().toISOString(),
22557
22557
  path: request.url,
22558
+ ...(exception
22559
+ ? {
22560
+ type: this.getExceptionType(exception),
22561
+ message: this.getExceptionMessage(exception),
22562
+ stack: this.getExceptionStack(exception),
22563
+ }
22564
+ : {}),
22558
22565
  });
22559
22566
  }
22567
+ getExceptionType(exception) {
22568
+ return exception.constructor?.name;
22569
+ }
22570
+ getExceptionStack(exception) {
22571
+ return exception.stack;
22572
+ }
22573
+ getExceptionMessage(exception) {
22574
+ return exception.message ?? "Internal server error";
22575
+ }
22560
22576
  getErrorStatusCode(exception) {
22561
22577
  const customErrorCode = this.getCustomErrorStatusCode(exception);
22562
22578
  if (customErrorCode) {