From 39d75606a4cbec14d6f9f9d4e295dad4e3711682 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Thu, 11 Feb 2016 11:41:35 -0800 Subject: [PATCH] Document specific errors returned by CheckResponse. --- github/github.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/github/github.go b/github/github.go index 2f6a5b0..f9f27e2 100644 --- a/github/github.go +++ b/github/github.go @@ -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