ShouldRetryHTTP returns a boolean as to whether this resp deserves. It checks to see if the HTTP response code is in the slice retryErrorCodes.
(resp *http.Response, retryErrorCodes []int)
| 437 | // It checks to see if the HTTP response code is in the slice |
| 438 | // retryErrorCodes. |
| 439 | func ShouldRetryHTTP(resp *http.Response, retryErrorCodes []int) bool { |
| 440 | if resp == nil { |
| 441 | return false |
| 442 | } |
| 443 | return slices.Contains(retryErrorCodes, resp.StatusCode) |
| 444 | } |
| 445 | |
| 446 | // ContextError checks to see if ctx is in error. |
| 447 | // |
no test coverage detected
searching dependent graphs…