Skip to content

Preserve error response bodies before raising - #9

Closed
lineoffligbot wants to merge 2 commits into
mainfrom
flushed-raise-error
Closed

Preserve error response bodies before raising#9
lineoffligbot wants to merge 2 commits into
mainfrom
flushed-raise-error

Conversation

@lineoffligbot

Copy link
Copy Markdown
Contributor

Fixes #8. Replaces the http gem's raise_error feature with flushed_raise_error, which reads the body before raising so HTTP::StatusError#response.body survives the connection close in HTTP::Client#perform. Covers both API builder branches and the LWA token client. Tested against a real TCP server (WebMock bypasses the code path that loses the body).

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.

Error responses lose their body when raise_error closes the connection

2 participants