isTransientHTTPStatus reports whether the HTTP status code indicates a transient server error that should not permanently break the connection.
(statusCode int)
| 2274 | // isTransientHTTPStatus reports whether the HTTP status code indicates a |
| 2275 | // transient server error that should not permanently break the connection. |
| 2276 | func isTransientHTTPStatus(statusCode int) bool { |
| 2277 | switch statusCode { |
| 2278 | case http.StatusInternalServerError, // 500 |
| 2279 | http.StatusBadGateway, // 502 |
| 2280 | http.StatusServiceUnavailable, // 503 |
| 2281 | http.StatusGatewayTimeout, // 504 |
| 2282 | http.StatusTooManyRequests: // 429 |
| 2283 | return true |
| 2284 | } |
| 2285 | return false |
| 2286 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…