Package: @hexos/runtime

Determines whether an error is transient and safe to retry.

Classifies errors as retryable based on three criteria:

  1. HTTP status codes: 408 (timeout), 429 (rate limit), 5xx (server errors)
  2. Network error codes: ECONNRESET, ETIMEDOUT, ECONNREFUSED, etc.
  3. Error message keywords: “timeout”, “rate limit”, “temporarily unavailable”, “network”

Used as the default predicate for retryWithBackoff when no custom shouldRetry function is provided.

function isRetryableError(error: unknown): boolean

Parameters

error

unknown