@crawlee/basic 4.0.0-beta.78 → 4.0.0-beta.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,15 @@ import { TimeoutError } from '@apify/timeout';
7
7
  export interface BasicCrawlingContext<UserData extends Dictionary = Dictionary> extends CrawlingContext<UserData> {
8
8
  }
9
9
  export type RequestHandler<Context extends CrawlingContext = CrawlingContext> = (inputs: Context) => Awaitable<void>;
10
- export type ErrorHandler<Context extends CrawlingContext = CrawlingContext, ExtendedContext extends Context = Context> = (inputs: Context & Partial<ExtendedContext>, error: Error) => Awaitable<void>;
10
+ /**
11
+ * An error handler receives the crawling context and the error that was thrown while processing the request.
12
+ *
13
+ * Unlike the {@link RequestHandler}, an error handler may run before the context pipeline has finished
14
+ * building the full context (e.g. when navigation or session setup fails). Therefore only `BaseContext` is
15
+ * guaranteed to be present, while the extra properties added by the pipeline and `extendContext` (the
16
+ * difference between `BaseContext` and `ExtendedContext`) are only available as a `Partial`.
17
+ */
18
+ export type ErrorHandler<BaseContext extends CrawlingContext = CrawlingContext, ExtendedContext extends BaseContext = BaseContext> = (inputs: BaseContext & Partial<ExtendedContext>, error: Error) => Awaitable<void>;
11
19
  export interface StatusMessageCallbackParams<Context extends CrawlingContext = BasicCrawlingContext, Crawler extends BasicCrawler<any> = BasicCrawler<Context>> {
12
20
  state: StatisticState;
13
21
  crawler: Crawler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/basic",
3
- "version": "4.0.0-beta.78",
3
+ "version": "4.0.0-beta.79",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -42,10 +42,10 @@
42
42
  "@apify/datastructures": "^2.0.0",
43
43
  "@apify/timeout": "^0.3.2",
44
44
  "@apify/utilities": "^2.15.5",
45
- "@crawlee/core": "4.0.0-beta.78",
46
- "@crawlee/http-client": "4.0.0-beta.78",
47
- "@crawlee/types": "4.0.0-beta.78",
48
- "@crawlee/utils": "4.0.0-beta.78",
45
+ "@crawlee/core": "4.0.0-beta.79",
46
+ "@crawlee/http-client": "4.0.0-beta.79",
47
+ "@crawlee/types": "4.0.0-beta.79",
48
+ "@crawlee/utils": "4.0.0-beta.79",
49
49
  "csv-stringify": "^6.5.2",
50
50
  "fs-extra": "^11.3.0",
51
51
  "ow": "^2.0.0",
@@ -54,7 +54,7 @@
54
54
  "type-fest": "^4.41.0"
55
55
  },
56
56
  "optionalDependencies": {
57
- "@crawlee/impit-client": "^4.0.0-beta.78"
57
+ "@crawlee/impit-client": "^4.0.0-beta.79"
58
58
  },
59
59
  "lerna": {
60
60
  "command": {
@@ -63,5 +63,5 @@
63
63
  }
64
64
  }
65
65
  },
66
- "gitHead": "e6c53f94d11cf6e0885855255c0d9ac8071459fa"
66
+ "gitHead": "e897f0881c8142a1fd32f315263751296b4f1a22"
67
67
  }