Skip to content

Commit

Permalink
Do not retry after receiving 500 http response
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Aug 18, 2023
1 parent 760979e commit ae8df3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.1 (unreleased)

- Do not retry after receiving 500 HTTP response

## 0.1.0

- Initial release
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (client *Client) Do(req Req) (Res, error) {
log.Printf("[ERROR] HTTP Request failed: StatusCode %v", httpRes.StatusCode)
log.Printf("[DEBUG] Exit from Do method")
return res, fmt.Errorf("HTTP Request failed: StatusCode %v", httpRes.StatusCode)
} else if httpRes.StatusCode == 408 || (httpRes.StatusCode >= 500 && httpRes.StatusCode <= 599) {
} else if httpRes.StatusCode == 408 || (httpRes.StatusCode >= 501 && httpRes.StatusCode <= 599) {
log.Printf("[ERROR] HTTP Request failed: StatusCode %v, Retries: %v", httpRes.StatusCode, attempts)
continue
} else {
Expand Down

0 comments on commit ae8df3c

Please sign in to comment.