MCPcopy Create free account
hub / github.com/auth0/auth0-cli / retryableErrorTransport

Function retryableErrorTransport

internal/cli/management.go:85–108  ·  view source on GitHub ↗
(tripper http.RoundTripper)

Source from the content-addressed store, hash-verified

83}
84
85func retryableErrorTransport(tripper http.RoundTripper) http.RoundTripper {
86 retryableCodes := []int{
87 http.StatusServiceUnavailable,
88 http.StatusInternalServerError,
89 http.StatusBadGateway,
90 http.StatusGatewayTimeout,
91 // Cloudflare-specific server error that is generated
92 // because Cloudflare did not receive an HTTP response
93 // from the origin server after an HTTP Connection was made.
94 524,
95 }
96
97 return rehttp.NewTransport(
98 tripper,
99 rehttp.RetryAll(
100 rehttp.RetryMaxRetries(3),
101 rehttp.RetryAny(
102 rehttp.RetryStatuses(retryableCodes...),
103 rehttp.RetryIsErr(retryableErrorRetryFunc),
104 ),
105 ),
106 rehttp.ExpJitterDelay(500*time.Millisecond, 10*time.Second),
107 )
108}
109
110func retryableErrorRetryFunc(err error) bool {
111 if err == nil {

Callers 1

customClientWithRetriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected