Skip to content

Commit

Permalink
Log retries
Browse files Browse the repository at this point in the history
  • Loading branch information
MDrakos committed Nov 8, 2024
1 parent d0c984f commit d092e16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/retryhttp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

"github.com/ActiveState/cli/internal/constants"
"github.com/ActiveState/cli/internal/logging"
"github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/go-retryablehttp"
"github.com/thoas/go-funk"
Expand Down Expand Up @@ -139,6 +140,7 @@ func normalizeResponse(res *http.Response, err error) (*http.Response, error) {
}

func normalizeRetryResponse(res *http.Response, err error, numTries int) (*http.Response, error) {
logging.Debug("Retry failed with error: %v, after %d tries", err, numTries)
if err2, ok := err.(net.Error); ok && err2.Timeout() {
return res, locale.WrapExternalError(&UserNetworkError{-1}, "err_user_network_timeout", "", locale.Tr("err_user_network_solution", constants.ForumsURL))
}
Expand Down

0 comments on commit d092e16

Please sign in to comment.