1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.ExceptionFiltersContext = void 0;
|
4 | const constants_1 = require("@nestjs/common/constants");
|
5 | const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
6 | const base_exception_filter_context_1 = require("@nestjs/core/exceptions/base-exception-filter-context");
|
7 | const ws_exceptions_handler_1 = require("../exceptions/ws-exceptions-handler");
|
8 |
|
9 |
|
10 |
|
11 | class ExceptionFiltersContext extends base_exception_filter_context_1.BaseExceptionFilterContext {
|
12 | constructor(container) {
|
13 | super(container);
|
14 | }
|
15 | create(instance, callback, moduleKey) {
|
16 | this.moduleContext = moduleKey;
|
17 | const exceptionHandler = new ws_exceptions_handler_1.WsExceptionsHandler();
|
18 | const filters = this.createContext(instance, callback, constants_1.EXCEPTION_FILTERS_METADATA);
|
19 | if ((0, shared_utils_1.isEmpty)(filters)) {
|
20 | return exceptionHandler;
|
21 | }
|
22 | exceptionHandler.setCustomFilters(filters.reverse());
|
23 | return exceptionHandler;
|
24 | }
|
25 | getGlobalMetadata() {
|
26 | return [];
|
27 | }
|
28 | }
|
29 | exports.ExceptionFiltersContext = ExceptionFiltersContext;
|