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

Read body of error response #52

Closed
wants to merge 2 commits into from
Closed

Read body of error response #52

wants to merge 2 commits into from

Conversation

fdcds
Copy link
Contributor

@fdcds fdcds commented Aug 20, 2021

Previously a failing request to retrieve a request token or an access token with an unexpected status code was hard to debug, because additional information returned by the server in the body of the response was inaccessible to the user of this library.

This patch changes that by including the body in the error message. Since the body is now read before the potential status code error is returned, but it is crucial information for debugging, we also include the status code in an error resulting from reading the body.

Previously a failing request to retrieve a request token or an access token with an unexpected status code was hard to debug, because additional information returned by the server in the body of the response was inaccessible to the user of this library.

This patch changes that by including the body in the error message. Since the body is now read before the potential status code error is returned, but it is crucial information for debugging, we also include the status code in an error resulting from reading the body.
config.go Outdated Show resolved Hide resolved
@dghubble
Copy link
Owner

dghubble commented Oct 2, 2021

Added via #54

@dghubble dghubble closed this Oct 2, 2021
@fdcds fdcds deleted the patch-1 branch January 18, 2022 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants