Browse Source

Document specific errors returned by CheckResponse.

Dmitri Shuralyov 10 years ago
committed by Will Norris
parent
commit
39d75606a4
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      github/github.go

+ 3
- 0
github/github.go View File

@ -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


Loading…
Cancel
Save