Skip to main content
Every failure in Reader surfaces as a typed error. This page covers the mental model; see API Reference - Errors for the full class list.

Everything is typed

All errors extend a base ReaderError class and carry:
  • code - a stable string like TIMEOUT or NETWORK_ERROR
  • message - human-readable description
  • retryable - a boolean telling you whether this is a transient failure worth retrying
  • url - the URL that failed (when applicable)
  • toJSON() - structured output for logging

The retryable flag

retryable: true means the error is transient and a retry with the same input might succeed. retryable: false means the error is terminal - retrying won’t help. Examples of retryable errors:
  • NETWORK_ERROR - connection reset, socket error
  • TIMEOUT - page took too long to load
  • PROXY_CONNECTION_ERROR - proxy unreachable
  • BOT_DETECTED - might pass on retry with a different proxy
  • EMPTY_CONTENT - page might have been rate-limiting
Examples of non-retryable errors:
  • INVALID_URL - malformed URL, not going to improve
  • DNS_ERROR - hostname doesn’t exist
  • ROBOTS_BLOCKED - robots.txt forbids it
  • ACCESS_DENIED - 401/403 from the origin
  • PROXY_EXHAUSTED - all proxy tiers tried and failed
  • VALIDATION_ERROR - you passed bad options

Proxy tier handling

If a scrape fails with BOT_DETECTED using the standard (datacenter) tier, consider retrying with the premium (residential) tier:
Non-retryable errors (DNS failure, invalid URL, robots.txt) skip directly to failure without trying another tier. The timeouts are configurable per-request:

Error handling patterns

Simple try/catch

For one-off scripts, wrap the call and log:

Retry on retryable errors

For production code, check the flag:

Batch with partial failures

When scraping many URLs, a batch can partially succeed. The result’s batchMetadata.errors array tells you which URLs failed:
The successful URLs still come back in result.data. Batch scraping never throws on individual URL failures - only on framework-level errors (browser pool exhausted, invalid options, etc.).

Where to go next

Errors reference

Full table of every error class and its code.

Scraping Engine

How the Playwright engine and proxy tiers work.