octokit / go-octokit

Simple Go wrapper for the GitHub API
https://github.com/octokit/go-octokit
MIT License
258 stars 79 forks source link

Always return *ResponseError in NewReesponseError #56

Closed owenthereal closed 10 years ago

owenthereal commented 10 years ago

Previously it could happen that the response body can't be decoded and the return error is a different type from *ResponseError. This causes downstream usage to handle different types of errors.

The solution is to always return ResponseError and make the decoding error as part of the ResponseError.

pengwynn commented 10 years ago

:+1: