UNPKG

@tsed/common

Version:
23 lines 656 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Catch = void 0; const di_1 = require("@tsed/di"); const ExceptionFiltersContainer_1 = require("../domain/ExceptionFiltersContainer"); /** * Register a new class to handle an specific exception. * @decorator * @param types */ function Catch(...types) { return (target) => { types.forEach((type) => { ExceptionFiltersContainer_1.registerExceptionType(type, target); }); di_1.registerProvider({ provide: target, useClass: target }); }; } exports.Catch = Catch; //# sourceMappingURL=catch.js.map