这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@VictorAvelar
Copy link
Owner

Description

When a response body has been read, it is no longer accessible for reading and when an error occurs this blocks the user to obtain relevant information about the error.

This PR adds a refreshed ReadCloser to the Response once the content has been processed.

Motivation and context

Fixes #47

How has this been tested?

Test case added covering the reported error.

Screenshots (if appropriate)

Full object preview
Screenshot 2019-12-12 at 22 01 48

Reader enabled
Screenshot 2019-12-12 at 22 02 01

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.

  • I have read the CONTRIBUTING document.
  • My pull request addresses exactly one patch/feature.
  • I have created a branch for this patch/feature.
  • Each individual commit in the pull request is meaningful.
  • I have added tests to cover my changes.
  • If my change requires a change to the documentation, I have updated it accordingly.

After this feature, the response body its accessible outside of the main error/response decoding method (client.Do)
@VictorAvelar VictorAvelar added the bug Something isn't working label Dec 12, 2019
@VictorAvelar VictorAvelar self-assigned this Dec 12, 2019
@VictorAvelar VictorAvelar merged commit 52e9e46 into master Dec 14, 2019
@VictorAvelar VictorAvelar deleted the response-closed-error branch December 14, 2019 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't access error response from Client payment creation

2 participants