-
Notifications
You must be signed in to change notification settings - Fork 93
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
returns NetworkError when the request response returns a non-200 http status code #143
returns NetworkError when the request response returns a non-200 http status code #143
Conversation
…n-200 http status code
Thanks for your quick reviews @hgiasac. I have added the changes suggested. Let me know if there's any others needed. |
@LukeSparkLayer the change looks good. However, you need to fix the error message in unit tests as well. We can merge after all tests are passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for contributing
This PR adds a new error type: NetworkError
This error contains the status code and response body which were previously returned as the error message.
This change has two benefits:
Returns the body of the request as anio.Reader
to reduce unnecessary data being passed around.