Understand error handling and retry mechanisms
mainThe library automatically handles intermittent HTTP errors and rate limits using an exponential backoff strategy with jitter.
Retried HTTP Status Codes:
408(Request Timeout)429(Too Many Requests)502(Bad Gateway)503(Service Unavailable)504(Gateway Timeout)
Retry Logic Details:
- Initial Wait: 1 second, increasing exponentially.
- Jitter: Includes a random jitter of up to 10 seconds to prevent thundering herd problems.
- Limits: Retries stop after
max_retriesattempts or when the wait time reachesmax_retry_wait_time. Exceeding these limits raises an exception.
Parsing Errors:
If an unrecoverable error occurs during parsing, the resulting object for the affected page(s) will include an errors field containing the error_message, error_code, and the page number.