Catch agnostic HTTPError base in rabbitmq and swap the test#24251
Catch agnostic HTTPError base in rabbitmq and swap the test#24251mwdd146980 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 672456a2df
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Validation Report
Run Passed validations (20)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 672456a2df
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
What does this PR do?
Widens the
_get_data()exception catch in the RabbitMQ check to also catch the backend-agnosticHTTPErrorbase alongside the existingrequestsRequestException. The unit test injection swaps to the agnosticHTTPStatusErrorinstance.Motivation
Part of the httpx migration. Once the HTTP layer can raise agnostic errors, a catch that only knows
RequestExceptionwould let an agnostic status error escape_get_datainstead of being re-raised asRabbitMQException. Widening the catch keeps the check correct under either backend. There is no observable behavior change under the shippedrequestsbackend, which never raises the agnostic type.Verification
Verified red-then-green. With
HTTPStatusError("error")injected but_get_datastill catching onlyRequestException, the agnostic error escapes the clause andtest__get_datafails withHTTPStatusError(not aTypeError, confirming the instance form is correct). Widening the catch to(RequestException, HTTPError)makes it pass. The full rabbitmq unit suite is green.Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged🤖 Generated with Claude Code