Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

chore: fix timeout error messages having wrong timeouts

Martin Adámekd3f65ff62594
diff --git a/src/crawlers/basic_crawler.js b/src/crawlers/basic_crawler.js
index 9d260c488..2c8468dc1 100644
--- a/src/crawlers/basic_crawler.js
+++ b/src/crawlers/basic_crawler.js
@@ -487,7 +487,7 @@ export class BasicCrawler {
}
},
this.handleRequestTimeoutMillis,
- `Fetching next request timed out after ${this.handleRequestTimeoutMillis * 1e3} seconds.`,
+ `Fetching next request timed out after ${this.handleRequestTimeoutMillis / 1e3} seconds.`,
);
tryCancel();
@@ -520,7 +520,7 @@ export class BasicCrawler {
await this._timeoutAndRetry(
() => source.markRequestHandled(request),
this.handleRequestTimeoutMillis,
- `Marking request ${request.url} as handled timed out after ${this.handleRequestTimeoutMillis * 1e3} seconds.`,
+ `Marking request ${request.url} as handled timed out after ${this.handleRequestTimeoutMillis / 1e3} seconds.`,
);
tryCancel();
this.stats.finishJob(statisticsId);
@@ -533,7 +533,7 @@ export class BasicCrawler {
await this._timeoutAndRetry(
() => this._requestFunctionErrorHandler(err, crawlingContext, source),
this.handleRequestTimeoutMillis,
- `Handling request failure of ${request.url} timed out after ${this.handleRequestTimeoutMillis * 1e3} seconds.`,
+ `Handling request failure of ${request.url} timed out after ${this.handleRequestTimeoutMillis / 1e3} seconds.`,
);
} catch (secondaryError) {
this.log.exception(secondaryError, 'runTaskFunction error handler threw an exception. '