Skip to content

Preserve the body-decode error in ParseError#49

Merged
germ-mark merged 1 commit into
mainfrom
fix/preserve-decode-error
Jul 15, 2026
Merged

Preserve the body-decode error in ParseError#49
germ-mark merged 1 commit into
mainfrom
fix/preserve-decode-error

Conversation

@germ-mark

Copy link
Copy Markdown
Contributor

ResponseParsing.parse collapsed every thrown decode error into .unrecognized(HTTPResponse), which carries only the response headers — so a well-formed 200 whose body failed to decode reported identically to an unknown status, discarding the DecodingError and its coding path. This is what turned the unpadded-$bytes bug (#48) into a debugger session instead of a log read.

Adds ParseError.undecodable(HTTPResponse, underlying: any Error) and returns it from the catch. Additive only: ParseError is consumed via specific-case catch patterns (e.g. AtprotoClient's callExpectingOptional), so no existing matching changes behavior.

🤖 Generated with Claude Code

The parse catch collapsed every decode failure into .unrecognized,
which carries only the response headers — a well-formed 200 whose body
failed to decode reported the same as an unknown status, hiding the
DecodingError (and its coding path) that says what actually broke.
Carry it in a new .undecodable case.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7575e37

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@germ-network/atprototypes Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@germ-mark germ-mark merged commit a994130 into main Jul 15, 2026
8 checks passed
@germ-mark germ-mark deleted the fix/preserve-decode-error branch July 15, 2026 20:02
@github-actions github-actions Bot mentioned this pull request Jul 15, 2026
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