diff --git a/platform-includes/getting-started-use/javascript.nestjs.mdx b/platform-includes/getting-started-use/javascript.nestjs.mdx index ba5c937d25881b..dc5fe5d560f3d1 100644 --- a/platform-includes/getting-started-use/javascript.nestjs.mdx +++ b/platform-includes/getting-started-use/javascript.nestjs.mdx @@ -49,6 +49,8 @@ export class YourCatchAllExceptionFilter implements ExceptionFilter { } ``` +By default, only unhandled exceptions that are not caught by an error filter are reported to Sentry. +`HttpException`s (including [derivatives](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)) are also not captured by default because they mostly act as control flow vehicles. {/* TODO(v9): Remove this note */} _Note that `@SentryExceptionCaptured()` was called `@WithSentry` in SDK versions `8.38.0` and prior._ @@ -73,12 +75,13 @@ import { SentryGlobalFilter } from "@sentry/nestjs/setup"; }) export class AppModule {} ``` + {/* TODO(v9): Remove this note. */} **Note:** If you have a NestJS + GraphQL application and you are using the `@sentry/nestjs` SDK version `8.38.0` or earlier, replace the `SentryGlobalFilter` with the `SentryGlobalGenericFilter`. In SDK versions `8.39.0` and above, the `SentryGlobalGenericFilter` is deprecated because the `SentryGlobalFilter` will handle GraphQL contexts automatically. -By default, exceptions with status code 4xx are not sent to Sentry. If you still want to capture these exceptions, you can do so manually with `Sentry.captureException()`: +If you have error filters for specific types of exceptions (for example `@Catch(HttpException)`, or any other `@Catch(...)` with arguments) and you want to capture errors caught by these filters, capture the errors in the `catch()` handler with `Sentry.captureException()`: ```javascript {9} import { ArgumentsHost, BadRequestException, Catch } from '@nestjs/common';