docs(js): Add callout for websocket handling in nestjs#18767
Merged
Conversation
Comment on lines
+102
to
+106
| `SentryGlobalFilter` handles WebSocket exceptions, but NestJS doesn't apply filters registered via `APP_FILTER` to WebSocket gateways. To make sure errors thrown in a gateway are captured, add the `@UseFilters()` decorator directly to the gateway class, even if `SentryGlobalFilter` is already registered as a global provider. | ||
|
|
||
| </SplitSectionText> | ||
| <SplitSectionCode> | ||
|
|
Contributor
There was a problem hiding this comment.
Bug: The documentation for SentryGlobalFilter omits the minimum SDK version required for WebSocket exception handling, which can lead to silent error-capturing failures on older versions.
Severity: MEDIUM
Suggested Fix
Update the documentation to specify the minimum version of the @sentry/nestjs SDK required for SentryGlobalFilter to capture WebSocket exceptions. For example, add a note stating that this feature requires a specific version or newer.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location:
platform-includes/getting-started-capture-errors/javascript.nestjs.mdx#L102-L106
Potential issue: The documentation asserts that `SentryGlobalFilter` handles WebSocket
exceptions in NestJS. However, this functionality was introduced in a specific version
of the `@sentry/nestjs` SDK (e.g., v8.40.0). The guide does not mention this version
requirement. Developers using an older, unsupported SDK version who follow this
documentation will find that their WebSocket exception filters fail silently, and errors
will not be captured by Sentry. This creates a situation where error handling appears to
be correctly configured but is non-functional.
Did we get this right? 👍 / 👎 to inform future reviews.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
nicohrubec
approved these changes
Jul 20, 2026
inventarSarah
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
documents getsentry/sentry-javascript#22224