Skip to content

fix(client): raise informative error on non-404 fetch failure - #19

Merged
vidiecan merged 1 commit into
dtqfrom
fix/explicit-fetch-errors
Aug 17, 2026
Merged

fix(client): raise informative error on non-404 fetch failure#19
vidiecan merged 1 commit into
dtqfrom
fix/explicit-fetch-errors

Conversation

@vidiecan

Copy link
Copy Markdown

Follow-up to #18, addressing a Copilot review note.

get_bundles and get_bitstreams return [] on a 404 (deleted item/bundle).
On any other failure fetch_resource returns None and the code then
subscripted it, surfacing an opaque 'NoneType' object is not subscriptable
TypeError with no HTTP status or url. Both now raise an explicit RuntimeError
carrying the status + url, so a transient 5xx is a legible, retryable error
instead of a mystery crash.

Tests assert the status and url are in the message. 63 tests, no network.

get_bundles and get_bitstreams already return [] on a 404 (deleted item or
bundle). On any other failure fetch_resource returns None and the code then
subscripted it, surfacing an opaque 'NoneType is not subscriptable' TypeError
with no status or url. Raise an explicit RuntimeError carrying the HTTP status
and url instead, so a transient 5xx is a legible, retryable error.

Addresses a Copilot review note; tests assert the status/url is in the message.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vidiecan
vidiecan merged commit dbabf5d into dtq Aug 17, 2026
2 checks passed
@vidiecan
vidiecan deleted the fix/explicit-fetch-errors branch August 17, 2026 19:12
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.

1 participant