Skip to content

Commit

Permalink
fix: error messages arent supposed to end in puncuation I guess
Browse files Browse the repository at this point in the history
  • Loading branch information
benwaples committed Apr 2, 2024
1 parent 3f3dabe commit 976964f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/rest/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (s *restClient) send(req *http.Request) (*http.Response, error) {
// Try the request
if res, err = s.http.Do(req); err != nil {
if IsClosedConnectionErr(err) {
fmt.Printf("remote host force closed connection while requesting %s; attempt %d/%d; trying again...\n", req.URL, retry+1, maxRetries)
fmt.Printf("remote host force closed connection while requesting %s; attempt %d/%d; trying again\n", req.URL, retry+1, maxRetries)
ExponentialBackoff(retry)
continue
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func ingest(ctx context.Context, bheUrl url.URL, bheClient *http.Client, in <-ch
if response, err := bheClient.Do(req); err != nil {
if rest.IsClosedConnectionErr(err) {
// try again on force closed connection
log.Error(err, "remote host force closed connection while requesting %s; attempt %d/%d; trying again...", req.URL, retry+1, maxRetries)
log.Error(err, "remote host force closed connection while requesting %s; attempt %d/%d; trying again", req.URL, retry+1, maxRetries)
rest.ExponentialBackoff(retry)

if retry == maxRetries-1 {
Expand All @@ -233,8 +233,8 @@ func ingest(ctx context.Context, bheUrl url.URL, bheClient *http.Client, in <-ch
log.Error(err, unrecoverableErrMsg)
return true
} else if response.StatusCode == http.StatusGatewayTimeout || response.StatusCode == http.StatusServiceUnavailable || response.StatusCode == http.StatusBadGateway {
serverError := fmt.Errorf("received server error %d while requesting %v;", response.StatusCode, endpoint)
log.Error(serverError, "attempt %d/%d; trying again...", retry+1, maxRetries)
serverError := fmt.Errorf("received server error %d while requesting %v; attempt %d/%d; trying again", response.StatusCode, endpoint, retry+1, maxRetries)
log.Error(serverError, "")

rest.ExponentialBackoff(retry)

Expand Down Expand Up @@ -288,7 +288,7 @@ func do(bheClient *http.Client, req *http.Request) (*http.Response, error) {
if res, err = bheClient.Do(req); err != nil {
if rest.IsClosedConnectionErr(err) {
// try again on force closed connections
log.Error(err, "remote host force closed connection while requesting %s; attempt %d/%d; trying again...", req.URL, retry+1, maxRetries)
log.Error(err, "remote host force closed connection while requesting %s; attempt %d/%d; trying again", req.URL, retry+1, maxRetries)
rest.ExponentialBackoff(retry)
continue
}
Expand All @@ -298,7 +298,7 @@ func do(bheClient *http.Client, req *http.Request) (*http.Response, error) {
if res.StatusCode >= http.StatusInternalServerError {
// Internal server error, backoff and try again.
serverError := fmt.Errorf("received server error %d while requesting %v", res.StatusCode, req.URL)
log.Error(serverError, "attempt %d/%d; trying again...", retry+1, maxRetries)
log.Error(serverError, "attempt %d/%d; trying again", retry+1, maxRetries)

rest.ExponentialBackoff(retry)
continue
Expand Down

0 comments on commit 976964f

Please sign in to comment.