UseFilters

Decorator that binds exception filters to the scope of the controller or method, depending on its context.

See more...


const UseFilters: (...filters: (Function | ExceptionFilter<any>)[]) => MethodDecorator & ClassDecorator;

See also

Description

When @UseFilters is used at the controller level, the filter will be applied to every handler (method) in the controller.

When @UseFilters is used at the individual handler level, the filter will apply only to that specific method.

Further information is available in the Usage Notes...

Usage notes

Exception filters can also be set up globally for all controllers and routes using app.useGlobalFilters(). See here for details