Decide the public status of `ContextPipelineInterruptedError` before 4.0
Author: janbucharCreated Sep 18, 2026Updated Sep 22, 2026
Labelst-tooling
- related to #3264
- Throwing it from
preNavigationHooks/extendContextis currently the only way to skip a request without it counting as a failure — no retry, norequestsFailed, no error log, request marked handled. It replaces the v3 hack ofnoRetry+ throw + decrementingrequestsFailed+ patchinglog.error. - It is exported
@publicfrom@crawlee/basicbut has no JSDoc or guide entry, its message talks about "context initialization", it is only honoured from pipeline middleware (fromrequestHandlerit is wrapped inRequestHandlerErrorand treated as a normal failure), it bypassesonSkippedRequestand never setsrequest.state = SKIPPED, and the request transaction rolls back anything written before the throw. - Two ways out: bless it (document it, honour it from
requestHandlertoo, route it through the same skip bookkeeping as the robots.txt / redirect skips), or mark it@internalnow and addcontext.skipRequest(reason?)as the public API. - Un-exporting it and changing how
requestHandlertreats it are both cheap before stable;skipRequest()itself is additive and can follow.
Source: apify/crawlee