# All files / common/decorators/core catch.decorator.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 2/2
100% Lines 4/4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    131x

    1x
    4x
    4x

     import { FILTER_CATCH_EXCEPTIONS } from '../../constants';
    import { Type } from '../../interfaces';

    /**
     * Defines the Exceptions Filter. Takes set of exception types as an argument which has to be caught by this Filter.
     * The class should implement the `ExceptionFilter` interface.
     */
    export function Catch(...exceptions: Type<any>[]): ClassDecorator {
      return (target: object) => {
        Reflect.defineMetadata(FILTER_CATCH_EXCEPTIONS, exceptions, target);
      };
    }