Skip to content

Respect FilterBadGatewayExceptions when initializing in code - #2930

Draft
bitsandfoxes wants to merge 3 commits into
mainfrom
fix/badgateway-filter-manual-init
Draft

bitsandfoxes wants to merge 3 commits into
mainfrom
fix/badgateway-filter-manual-init

Conversation

@bitsandfoxes

Copy link
Copy Markdown
Contributor

Setting FilterBadGatewayExceptions = false takes effect when the SDK is initialized in code with SentrySdk.Init.

The Bad Gateway exception filter is added to every SentryUnityOptions when it's created. The check that removes it when the option is off ran only while loading the options from the configuration window, so a code-only init kept the filter regardless of the option.

The check now runs in SentryUnitySdk.Init, which both the configuration window and code initialization go through, so it also respects a value changed in the options configure callback. The Web and Socket filters stay in ScriptableSentryUnityOptions, since those settings only exist in the configuration window.

Test: SentryUnity_FilterBadGatewayExceptionsDisabled_RemovesBadGatewayFilter initializes in code with the option off and checks the filter is gone.

🤖 Generated with Claude Code

@bitsandfoxes
bitsandfoxes force-pushed the fix/badgateway-filter-manual-init branch from 815de32 to b9e8ae8 Compare November 4, 2026 15:47
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.

1 participant