Skip to content

Unmarshal should check error by status-code as well.#465

Closed
prasad83 wants to merge 1 commit into
imroc:masterfrom
prasad83:master
Closed

Unmarshal should check error by status-code as well.#465
prasad83 wants to merge 1 commit into
imroc:masterfrom
prasad83:master

Conversation

@prasad83

Copy link
Copy Markdown

For status code (500) - resp.Err was nil
resp.Status was 500 INTERNAL SERVER ERROR

Do(...).Into() was failing to unmarshal

For status code (500) - resp.Err was nil 
resp.Status was 500 INTERNAL SERVER ERROR

Do(...).Into() was failing to unmarshal
imroc added a commit that referenced this pull request Jun 27, 2026
Closes PR #465 by @prasad83.

Unmarshal now checks IsErrorState() before attempting to deserialize.
Previously, a 4xx/5xx response body would be deserialized into the
target struct, which is rarely the intended behavior.
@imroc

imroc commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Thanks @prasad83! Merged in commit c64918d. Closing in favor of the merged fix.

@imroc imroc closed this Jun 27, 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.

2 participants