Question · NestJS course · Module 2: Routing and Request Lifecycle

The @Catch() Decorator

What does the @Catch(HttpException) decorator on an exception filter class mean?

Answer options

  • The filter catches only exceptions of the HttpException type
  • The filter catches all exceptions
  • The filter ignores HttpException
  • The filter generates new HttpException
Show the answer

Correct answer:

  • The filter catches only exceptions of the HttpException type