is_retryable_http_status

Documentation for eth_defi.gmx.retry.is_retryable_http_status function.

is_retryable_http_status(status_code)

Return True if an HTTP status should be retried.

5xx, 408 (request timeout) and 429 (rate limit) are transient and retried with backoff. Other 4xx (404, 400, 403, …) are permanent for that endpoint and fail over immediately without consuming the backoff budget.

Parameters

status_code (int) – HTTP status code from the response.

Returns

True when the status is retryable; False otherwise.

Return type

bool