Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
This was referenced Oct 24, 2026
The client retries 413, 429, 499, 500, 502, 503 and 504. When the last retry still gets one of those statuses, urllib3 raises MaxRetryError, so code that catches BadResponse misses rate limits and server errors. Add a raise_on_status argument, passed to the client's Retry. It defaults to True, which keeps today's MaxRetryError. With raise_on_status=False, urllib3 returns the last response and _get raises BadResponse with its status and body. The number of attempts and the backoff do not change. A custom Retry can already be passed through connection_pool_kw, but it replaces the client's status list and backoff, and makes the retries argument a no-op.
chipkent
force-pushed
the
feat/rest-raise-on-status
branch
from
October 24, 2026 14:55
a4601b6 to
9b1226d
Compare
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #<issue: F5b>
Builds on #12 (
BadResponse.status).The client retries 413, 429, 499, 500, 502, 503 and 504. If the last retry still gets one of them, urllib3 raises
MaxRetryError, so code that catchesBadResponsemisses rate limits and server errors.RESTClient(raise_on_status=...), passed to the client's urllib3Retry, for both the main client andclient.vx.True(the default) keeps today'sMaxRetryError. WithFalse, the client raisesBadResponsewith the status and body. Attempts and backoff are unchanged.Why not a custom
Retrythroughconnection_pool_kw(massive-com#1040)? That already works, and this PR adds no new capability. But it replaces the wholeRetry: the caller must copy the client's status list and backoff, which are not public and can drift, and theretriesargument silently stops applying. A plain keyword argument changes one setting and keeps the rest.Tests use a local HTTP server, because pook replaces urllib3's
urlopen, where retries happen. The backoff sleep is patched out.