GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Optionally raise instead of swallowing JSON decode errors by jakobovski-arb · Pull Request #1027 · massive-com/client-python Conversation
Contributor
The problem
try: obj = self._decode(resp) except ValueError as e: logger.error("Error decoding json response: %s", e) return [] A truncated or malformed body therefore becomes an empty result, which a caller cannot distinguish from "the API had nothing to return". The only trace is a log line, and the call itself succeeds. In This is not hypothetical. In a single multi-hour backfill over Each one produced an empty page that our pipeline recorded as a real absence — "this ticker had no auction print that day" — and cached permanently, because an empty response from a working API is a legitimate answer in our domain. We only found out by reading the log afterwards. For data ordered newest-first, where the row of interest sits on the last page, a truncated early page can drop exactly the record you were querying for. The change
Default is Caveats, in the interest of full disclosure
Tests
Context: we're the authors of #1026 ( 🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions_get and _paginate_iter decode every response inside `except ValueError: logger.error(...); return []`, so a truncated or malformed body becomes an empty result that a caller cannot distinguish from "the API had nothing". In _paginate_iter it is worse: the bare return ends iteration early, so a partial page silently truncates a result set that still looks complete. RESTClient(raise_on_decode_error=True) raises ResponseDecodeError instead. The default is unchanged, so this is not a breaking change.
jakobovski-arb
requested review from
jbonzo,
justinpolygon,
kschoche,
lukeoleson,
mmoghaddam385 and
suever
as code owners
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersAt least 1 approving review is required to merge this pull request. Uh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |