From 976964f21e275aecd46ed25612c9bbd3ed4051e0 Mon Sep 17 00:00:00 2001 From: Ben Waples Date: Tue, 2 Apr 2024 16:05:53 -0700 Subject: [PATCH] fix: error messages arent supposed to end in puncuation I guess --- client/rest/client.go | 2 +- cmd/start.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/rest/client.go b/client/rest/client.go index 8b110f9..919edc4 100644 --- a/client/rest/client.go +++ b/client/rest/client.go @@ -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 } diff --git a/cmd/start.go b/cmd/start.go index 4c6bd2a..8693140 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -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 { @@ -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) @@ -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 } @@ -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