Skip to content

fix(falcon): Handle integer HTTP statuses - #8139

Merged
sentrivana merged 3 commits into
getsentry:masterfrom
jap:int-status
Oct 28, 2026
Merged

sentrivana merged 3 commits into
getsentry:masterfrom
jap:int-status

Conversation

@jap

@jap jap commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Description

Add support for integer HTTP statuses in falcon Response objects and HTTPError/HTTPStatus exceptions.

The old code raised AttributeError: 'int' object has no attribute 'startswith' in bad places.

Issues

@jap
jap requested a review from a team as a code owner October 27, 2026 20:13

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4b8f9f6. Configure here.

Comment thread sentry_sdk/integrations/falcon.py Outdated

@sentrivana sentrivana left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @jap, this looks good to me.

@sentrivana
sentrivana enabled auto-merge (squash) October 28, 2026 08:19
@sentrivana
sentrivana disabled auto-merge October 28, 2026 08:31
jap added 2 commits October 28, 2026 09:35
This solves two issues:

Falcon 3 and higher allow setting Response.status to an int, and the
current code breaks on that.

Falcon 4 and higher allow setting HTTPError/HTTPStatus.status to an
int, and the current code breaks on that.
@jap

jap commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

oh that's weird, I though I had ran ruff.. let me try again

@sentrivana sentrivana left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey @jap, there are two blockers before we can merge this, and since the branch is not open to changes from maintainers, you'll unfortunately need to do them manually:

  1. Rebase/merge latest master once #8140 has been merged (fixes unrelated test failures)
  2. Lint the change with ruff, see https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md#development-tooling

That should make CI pass.

@sentrivana
sentrivana merged commit ed74ba7 into getsentry:master Oct 28, 2026
165 checks passed
@jap
jap deleted the int-status branch October 28, 2026 10:07
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.

falcon integration fails when response.status is an int

2 participants