Exception Filters — Basics · NestJS

Shape every HttpException response with a filter bound to the whole application, and see what the exceptions layer does with an error it does not recognise.

What you will learn

Read the theory for Exception Filters

All Basics lessons

All NestJS courses

loading types…

What you'll learn

  • Describe what the exceptions layer answers for an HttpException and for a plain Error, and why the two differ
  • Write an exception filter with @Catch(), ArgumentsHost and the response object, scoped to one exception family
  • Bind a filter globally and know which errors a global filter sees that a controller-scoped one does not