@mondart/nestjs-common-module 1.1.45 → 1.1.46

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.
@@ -1 +1,2 @@
1
1
  export * from './wrap-if-not-error.helper';
2
+ export * from './saga-exception-converter.helper';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./wrap-if-not-error.helper"), exports);
18
+ __exportStar(require("./saga-exception-converter.helper"), exports);
@@ -0,0 +1,3 @@
1
+ export declare class SagaExceptionConverterHelper {
2
+ static toHttpException(httpExceptionName: string, exception: any): void;
3
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SagaExceptionConverterHelper = void 0;
4
+ const exceptions = require("@nestjs/common/exceptions");
5
+ const common_1 = require("@nestjs/common");
6
+ class SagaExceptionConverterHelper {
7
+ static toHttpException(httpExceptionName, exception) {
8
+ if (exceptions[httpExceptionName])
9
+ throw new exceptions[httpExceptionName](exception);
10
+ else
11
+ throw new common_1.InternalServerErrorException(exception);
12
+ }
13
+ }
14
+ exports.SagaExceptionConverterHelper = SagaExceptionConverterHelper;