Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to get the body when status code != 200 #75

Closed
spolu opened this issue May 31, 2024 · 2 comments
Closed

Ability to get the body when status code != 200 #75

spolu opened this issue May 31, 2024 · 2 comments

Comments

@spolu
Copy link
Contributor

spolu commented May 31, 2024

What would be the best way to check the status code before streaming and getting a handle on the connection to parse the body in case where status code is not 200 ?

@keelerm84
Copy link
Member

Thank you for opening up that PR. I'll keep all conversation on that thread so we don't split any discussion.

@keelerm84
Copy link
Member

You should now be able to accomplish this with v0.13.0. An error of UnexpectedResponse will now include both a Response object include the status and header information, along with an ErrorBody type, which you can use to retrieve the body of the error.

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 a pull request may close this issue.

2 participants