ref(strawberry): Simplify span creation #5647
Merged
GitHub Actions / warden: find-bugs
completed
Mar 12, 2026 in 1m 0s
1 issue
find-bugs: Found 1 issue (1 medium)
Medium
Span.__exit__ always called with None arguments, preventing error status on exceptions - `sentry_sdk/integrations/strawberry.py:204`
The Span.__exit__ method checks if value is not None to set SPANSTATUS.INTERNAL_ERROR on the span when an exception occurs. By always calling self.graphql_span.__exit__(None, None, None), exceptions that occur during GraphQL operations won't mark the span as errored. This means error tracking for GraphQL operations loses exception context that the Span class is designed to capture.
Duration: 59.7s · Tokens: 176.9k in / 2.8k out · Cost: $0.32
Annotations
Check warning on line 204 in sentry_sdk/integrations/strawberry.py
github-actions / warden: find-bugs
Span.__exit__ always called with None arguments, preventing error status on exceptions
The `Span.__exit__` method checks if `value is not None` to set `SPANSTATUS.INTERNAL_ERROR` on the span when an exception occurs. By always calling `self.graphql_span.__exit__(None, None, None)`, exceptions that occur during GraphQL operations won't mark the span as errored. This means error tracking for GraphQL operations loses exception context that the Span class is designed to capture.
Loading