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

fix: return an error for non-2xx responses using error_for_status() #60

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

coreyphillips
Copy link
Contributor

  • Previously, the request function returned Ok(()) even if the HTTP response status was an error (4xx/5xx). By adding response.error_for_status()?, we correctly propagate HTTP errors rather than masking them, ensuring that timeouts and other non-2xx status codes produce an error as expected.

Previously, the request function returned Ok(()) even if the
HTTP response status was an error (4xx/5xx). By adding
`response.error_for_status()?`, we correctly propagate
HTTP errors rather than masking them, ensuring that timeouts and
other non-2xx status codes produce an error as expected.
@coreyphillips coreyphillips requested a review from Nuhvi December 11, 2024 20:53
@Nuhvi
Copy link
Collaborator

Nuhvi commented Dec 11, 2024

@coreyphillips do you need this to be published to crates io or can you just use main branch? I am in the middle of a very large update so there will be a new version by the end of the year anyway.

@coreyphillips
Copy link
Contributor Author

@Nuhvi, I can just use the main branch until the next update.

@Nuhvi Nuhvi merged commit f306f33 into main Dec 11, 2024
1 check passed
@coreyphillips coreyphillips deleted the fix/propagate-non-2xx-http-errors branch December 11, 2024 21:53
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