isRetryableStatusCode function

bool isRetryableStatusCode(
  1. int statusCode
)

Whether the given HTTP status code should be retried.

Implementation

bool isRetryableStatusCode(int statusCode) {
  return switch (statusCode) {
    408 || 429 || 500 || 502 || 503 || 504 => true,
    _ => false,
  };
}