Skip to main content
Every SDK raises the same Bedrock-named exceptions, so your existing error-handling paths — including catch-and-backoff logic keyed on ThrottlingException — port over unchanged. Every server-derived error carries message, statusCode, errorCode, requestId (quote it to support), retryAfterSeconds, and the raw response body.

Retry policy (Bedrock standard-mode analog)

  • Attempts = maxRetries + 1; the default is 2 retries (3 total attempts).
  • Retried: network errors, HTTP 429, 500, 502, 503, 504, and 408 — with full-jitter exponential backoff capped at 20 s, honoring any Retry-After header.
  • Never retried: auth failures, validation errors, unknown models, and budget exhaustion (BUDGET_EXCEEDED) — spending errors must never silently retry.
  • Streaming: retries apply only until response headers arrive. Once the first byte of the stream is consumed, a drop surfaces as ModelStreamErrorException — a partial generation is never silently replayed.