Skip to content

Commit

Permalink
api: Don't treat 429 as error (#2850)
Browse files Browse the repository at this point in the history
* api: Don't treat 429 as error

* Added parenthesis
  • Loading branch information
vishalnayak committed Jun 12, 2017
1 parent f155992 commit 1379053
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ func (r *Response) DecodeJSON(out interface{}) error {
// this will fully consume the response body, but will not close it. The
// body must still be closed manually.
func (r *Response) Error() error {
// 200 to 399 are okay status codes
if r.StatusCode >= 200 && r.StatusCode < 400 {
// 200 to 399 are okay status codes. 429 is the code for health status of
// standby nodes.
if (r.StatusCode >= 200 && r.StatusCode < 400) || r.StatusCode == 429 {
return nil
}

Expand Down

0 comments on commit 1379053

Please sign in to comment.