Skip to content

Commit

Permalink
Document specific errors returned by CheckResponse.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitshur committed Feb 11, 2016
1 parent 5a4a230 commit 76866e1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ func (e *Error) Error() string {
// the 200 range. API error responses are expected to have either no response
// body, or a JSON response body that maps to ErrorResponse. Any other
// response body will be silently ignored.
//
// The error type will be *RateLimitError for rate limit exceeded errors,
// and *TwoFactorAuthError for two-factor authentication errors.
func CheckResponse(r *http.Response) error {
if c := r.StatusCode; 200 <= c && c <= 299 {
return nil
Expand Down

0 comments on commit 76866e1

Please sign in to comment.