Skip to content

Commit

Permalink
Merge pull request #3589 from ActiveState/DX-3156
Browse files Browse the repository at this point in the history
Log retries
  • Loading branch information
MDrakos authored Nov 13, 2024
2 parents 48b1d05 + d092e16 commit 2379b9c
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 2379b9c

Please sign in to comment.