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

JSONClient.Do only populates APIError.Type and Message #37

Closed
dgouldin opened this issue Dec 23, 2014 · 3 comments
Closed

JSONClient.Do only populates APIError.Type and Message #37

dgouldin opened this issue Dec 23, 2014 · 3 comments
Labels
bug This issue is a bug. help wanted We are asking the community to submit a PR to resolve this issue.

Comments

@dgouldin
Copy link
Contributor

When JSONClient.Do encounters a non-200 response, it returns an APIError instance, but one with only Type and Message properties populated:

https://github.com/stripe/aws-go/blob/master/aws/json.go#L65

It would be useful to include the other potential properties of the error response as well.

@stripecodahale stripecodahale added bug This issue is a bug. help wanted We are asking the community to submit a PR to resolve this issue. labels Dec 27, 2014
@stripecodahale
Copy link
Contributor

I agree. I don't have time to work on this myself, but I'd happily accept a patch.

@stripecodahale
Copy link
Contributor

A recent PR added the response status code to APIError. Do you think that's sufficient for your needs, or did you have anything else in mind? Looking at what documentation exists for JSON-based protocols, I can't find any examples of attributes beyond Type and Message.

@stripecodahale
Copy link
Contributor

I'm going to close this, given the changes to the error handling in the past month. If there's a specific piece of information which isn't represented in the errors, please open another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. help wanted We are asking the community to submit a PR to resolve this issue.
Projects
None yet
Development

No branches or pull requests

2 participants