Repository navigation
Conversation
BaseClient._get raised BadResponse(resp.data.decode("utf-8")) for any
non-200 response, so the status code was lost. Callers had to guess from
the body whether the key was not entitled (403) or the resource was
missing (404).
BadResponse now takes a keyword-only status argument and stores it as an
attribute, and _get passes resp.status. Positional arguments still go to
Exception unchanged, so str(exc) and exc.args are the same as before, and
BadResponse() still works (status is None).
exceptions.py gets an __all__, so the package's star import does not
re-export typing.Optional as massive.Optional.
|
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
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: F5a>
BaseClient._getraisesBadResponse(resp.data.decode("utf-8"))for any non-200 response, so the HTTP status is lost. Callers have to parse the body to tell a 403 (not entitled) from a 404.BadResponsetakes a keyword-onlystatusand stores it as an attribute;_getpassesresp.status.str(exc)andexc.argsare still the response body.BadResponse()andBadResponse("msg")still work, withstatus=None.massive/exceptions.pygets an__all__, so the package'sfrom .exceptions import *does not re-export the newtyping.Optionalimport asmassive.Optional.Tests in
test_rest/test_bad_response.pydrive 403 and 404 through pook and check that construction without a status is unchanged.