You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❗ Note: This is a starting point for discussion, not a final decision. The team should review and adjust before any implementation begins.❗
Crawlee JS defines a structured exception hierarchy that controls retry behavior and crawler lifecycle, while Crawlee Python is missing several key exception types. Before implementing anything, this needs to be discussed with the whole team to agree on the target state — the final structure is not decided yet.
This issue is for discussion and planning, not immediate implementation.
In JS, throwing RetryRequestError in a handler overrides maxRequestRetries and forces the request to be retried. Python has no equivalent — users cannot signal "keep retrying this request" from within a handler.
In JS, SessionError extends RetryRequestError, which means session errors are also always retried (with a separate maxSessionRotations limit). In Python, SessionError already has special handling, but there's no general-purpose "always retry" error.
2. NonRetryableError — Skip retries entirely
In JS, throwing NonRetryableError marks the request as failed immediately without any retries. Python has no way for users to signal from a handler that an error should not be retried.
3. CriticalError — Shut down the crawler
In JS, CriticalError extends NonRetryableError and causes the entire crawler to abort. This is used for unrecoverable situations (e.g., no route found, browser won't launch). Python has no equivalent — unrecoverable errors don't trigger a clean crawler shutdown.
4. MissingRouteError — Router fails loudly
In JS, if no route matches a request label and there's no default handler, a MissingRouteError (extending CriticalError) is thrown, shutting down the crawler immediately. This makes misconfigured routers fail fast and visibly. In Python, this situation is handled differently (no dedicated error type).
Activity