Skip to content

APIError.Details empty for error responses #8

Description

@kayslay

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions