1.2.1 • Published 6 months ago

nestjs-conditional-exception-filter v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

nestjs-conditional-exception-filter

npm version npm downloads

A helper package to allow creating exception filters based on conditions on the exception!

Usage

npm install nestjs-conditional-exception-filter
import { Catch, ExceptionFilter } from '@nestjs/common'
import { filter } from 'nestjs-conditional-exception-filter'

@Catch(
  filter({
    // Define for which instance this filter should be applied.
    // This is optional, so your filter no longer needs to work over class instances only
    for: YourErrorClass, 
    // And add your refined condition in this callback predicate function
    when: (err) => true
  })
)
export class YourFilter implements ExceptionFilter {
  // ...
}
1.2.0

7 months ago

1.2.1

6 months ago

1.1.0

11 months ago

1.0.0

11 months ago

0.0.0-development

11 months ago