Skip to content

docs(js): Add callout for websocket handling in nestjs#18767

Merged
chargome merged 1 commit into
masterfrom
cg/nest-ws
Jul 21, 2026
Merged

docs(js): Add callout for websocket handling in nestjs#18767
chargome merged 1 commit into
masterfrom
cg/nest-ws

Conversation

@chargome

Copy link
Copy Markdown
Member

@chargome chargome self-assigned this Jul 20, 2026
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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview Jul 20, 2026 11:57am

Request Review

@chargome
chargome merged commit 9229c7f into master Jul 21, 2026
22 checks passed
@chargome
chargome deleted the cg/nest-ws branch July 21, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants