You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now, if there is an HTTP error during a request, the error code is caught and swallowed and a very useless message is returned in its place.
Google's Github Go API actually returns an entire Response object for each endpoint, along with the result "object" and an error. This makes sense, but I don't know that it's not overkill. Regardless, something must be done.
The text was updated successfully, but these errors were encountered:
Since 9ed4ce1 the error returned on a failed request is either from the net/http package or a string containing: "HTTP Error %d" % resp.StatusCode. It would probably be more useful if the error for non-2XX responses was an object containing the numerical HTTP status code.
I like it too. Let me think about what else should/could change if we do this. This would make all the "List" functions a little nicer, e.g. ListBeers could return ([]Beer, Response, error) and the Response object contains the information for pagination, and we could eliminate the BeerList type.
As of now, if there is an HTTP error during a request, the error code is caught and swallowed and a very useless message is returned in its place.
Google's Github Go API actually returns an entire Response object for each endpoint, along with the result "object" and an error. This makes sense, but I don't know that it's not overkill. Regardless, something must be done.
The text was updated successfully, but these errors were encountered: