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

APIError.Details empty for error responses #8

Open
kayslay opened this issue Aug 27, 2020 · 0 comments
Open

APIError.Details empty for error responses #8

kayslay opened this issue Aug 27, 2020 · 0 comments

Comments

@kayslay
Copy link

kayslay commented Aug 27, 2020

APIError.Details was empty because the ioutil.ReadAll was reading an empty http.Response.Body.

The body of the response was read earlier by the decodeResponse func before attempting to read it again in newAPIError.

Changed the signature of decodeResponse to accept a []byte as the second argument.

Example commit. Check changes made to paystack.go and error.go

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

No branches or pull requests

1 participant