isRetryableErrorCode static method

bool isRetryableErrorCode(
  1. int? code
)

Implementation

static bool isRetryableErrorCode(int? code) {
  const retryableCodes = {
    -1,  // 응답을 아예 못 받음 (타임아웃, 연결 끊김 등)
    408, // Request Timeout
    429, // Too Many Requests (rate limit)
    500, // Internal Server Error
    502, // Bad Gateway
    503, // Service Unavailable
    504, // Gateway Timeout
  };
  return code != null && retryableCodes.contains(code);
}