Skip to content

feat(nestjs): Handle Necord contexts in SentryGlobalFilter - #24326

Open
tiagovilasboas wants to merge 1 commit into
getsentry:developfrom
tiagovilasboas:cursor/necord-sentry-global-filter-c128
Open

feat(nestjs): Handle Necord contexts in SentryGlobalFilter#24326
tiagovilasboas wants to merge 1 commit into
getsentry:developfrom
tiagovilasboas:cursor/necord-sentry-global-filter-c128

Conversation

@tiagovilasboas

Copy link
Copy Markdown

Necord Discord handlers use a custom NestJS execution context (getType() === 'necord'). Those exceptions were falling through to the HTTP BaseExceptionFilter path, which expects an HTTP adapter and cannot reply to Discord interactions.

SentryGlobalFilter now treats Necord the same way as the other non-HTTP branches: capture unexpected errors, skip expected Nest control-flow exceptions, log Error instances, and return without delegating to HTTP handling.

The mechanism type follows the existing convention (auto.necord.nestjs.global_filter). No necord or discord.js dependency is added — context detection is the string Necord already sets on the execution host.

Fixes #18472

Fixes getsentry#18472

Co-authored-by: Tiago Vilas Boas <tcarvalhovb@gmail.com>
@tiagovilasboas
tiagovilasboas marked this pull request as ready for review September 10, 2026 23:27
@tiagovilasboas
tiagovilasboas requested a review from a team as a code owner September 10, 2026 23:27
@tiagovilasboas
tiagovilasboas requested review from mydea and s1gr1d and removed request for a team September 10, 2026 23:27
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.

[Nestjs] Support necord contexts in SentryGlobalFilter

1 participant