@mondart/nestjs-common-module 1.1.38 → 1.1.39

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.
@@ -15,6 +15,7 @@ const rxjs_1 = require("rxjs");
15
15
  const dto_1 = require("../dto");
16
16
  const enums_1 = require("../enums");
17
17
  const helpers_1 = require("../helpers");
18
+ const exceptions = require("@nestjs/common/exceptions");
18
19
  let GlobalExceptionFilter = class GlobalExceptionFilter {
19
20
  constructor() { }
20
21
  catch(exception, host) {
@@ -25,7 +26,8 @@ let GlobalExceptionFilter = class GlobalExceptionFilter {
25
26
  logger.error(`exceptionName: ${exception?.name}`, JSON.stringify(exception) ??
26
27
  exception?.message ??
27
28
  'Unknown exception occurred.');
28
- if (exception instanceof common_1.HttpException) {
29
+ const exceptionsName = Object.values(exceptions).map((exception) => exception.name);
30
+ if (exceptionsName.includes(exception.name)) {
29
31
  return (0, rxjs_1.throwError)(exception);
30
32
  }
31
33
  else {