Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions content/exception-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Best practice is to use the `HttpStatus` enum imported from `@nestjs/common`.

There is a **third** constructor argument (optional) - `options` - that can be used to provide an error [cause](https://nodejs.org/en/blog/release/v16.9.0/#error-cause). This `cause` object is not serialized into the response object, but it can be useful for logging purposes, providing valuable information about the inner error that caused the `HttpException` to be thrown.

> warning **Warning** When using NestJS with TypeScript, ensure the lib option or target in your tsconfig.json is set to at least "es2022" to avoid compilation errors.

Here's an example overriding the entire response body and providing an error cause:

```typescript
Expand Down