From c3dec3be5c1da2895a46de17f2f0c3d64faa8df2 Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Tue, 1 Oct 2024 12:51:07 -0700 Subject: [PATCH 1/2] Don't create a new error when http requests fail. This fixes an issue where we failed to retry rate limit errors. --- pkg/databricks/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/databricks/client.go b/pkg/databricks/client.go index fb05d3d6..2e42ea60 100644 --- a/pkg/databricks/client.go +++ b/pkg/databricks/client.go @@ -595,7 +595,7 @@ func (c *Client) doRequest(ctx context.Context, urlAddress *url.URL, method stri c.auth.Apply(req) resp, err := c.httpClient.Do(req, WithJSONResponse(&response)) if err != nil { - return fmt.Errorf("databricks-connector: error: %s", err.Error()) + return err } defer resp.Body.Close() From aecc04f6a18ccadf8d7fe03b40ec0327c703c1e0 Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Tue, 1 Oct 2024 12:59:30 -0700 Subject: [PATCH 2/2] Fix linter error --- pkg/connector/pagination.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/connector/pagination.go b/pkg/connector/pagination.go index d6c6b9cc..ca0c111d 100644 --- a/pkg/connector/pagination.go +++ b/pkg/connector/pagination.go @@ -51,7 +51,7 @@ func convertPageToken(token string) (uint, error) { func prepareNextToken(page uint, pageTotal int, total uint) string { var token string - next := page + uint(pageTotal) + next := page + uint(pageTotal) // #nosec G115 if next < total+1 { token = strconv.FormatUint(uint64(next), 10) }