Skip to content

Commit fa391c0

Browse files
Merge pull request #2548 from ufec/master
Update exception-filters.md
2 parents 260f990 + 6a46e49 commit fa391c0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

content/exception-filters.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ export class HttpExceptionFilter {
206206

207207
> info **Hint** All exception filters should implement the generic `ExceptionFilter<T>` interface. This requires you to provide the `catch(exception: T, host: ArgumentsHost)` method with its indicated signature. `T` indicates the type of the exception.
208208
209+
> warning **Warning** If you are using `@nestjs/platform-fastify` you can use `response.send()` instead of `response.json()`. Don't forget to import the correct types from `fastify`.
210+
209211
The `@Catch(HttpException)` decorator binds the required metadata to the exception filter, telling Nest that this particular filter is looking for exceptions of type `HttpException` and nothing else. The `@Catch()` decorator may take a single parameter, or a comma-separated list. This lets you set up the filter for several types of exceptions at once.
210212

211213
#### Arguments host

0 commit comments

Comments
 (0)