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.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
Better message in ApifyCallError
Jan Curn7faa209eee06
diff --git a/src/actor.js b/src/actor.jsindex 2f57d8d43..83b1e1d1f 100644--- a/src/actor.js+++ b/src/actor.js@@ -29,7 +29,7 @@ const tryParseDate = (str) => {** @ignore*/-const waitForRunToFinish = async ({ actId, runId, token, waitSecs }) => {+const waitForRunToFinish = async ({ actId, runId, token, waitSecs, taskId }) => {let updatedRun;const { acts } = apifyClient;@@ -57,10 +57,13 @@ const waitForRunToFinish = async ({ actId, runId, token, waitSecs }) => {}if (!updatedRun) {- throw new ApifyCallError({ id: runId, actId }, 'Apify.call() failed, cannot fetch run from a server');+ throw new ApifyCallError({ id: runId, actId }, 'Apify.call() failed, cannot fetch actor run details from the server');}if (updatedRun.status !== ACT_JOB_STATUSES.SUCCEEDED && updatedRun.status !== ACT_JOB_STATUSES.RUNNING) {- throw new ApifyCallError(updatedRun);+ const message = taskId+ ? `The actor task ${taskId} invoked by Apify.call() did not succeed`+ : `The actor ${actId} invoked by Apify.call() did not succeed`;+ throw new ApifyCallError(updatedRun, message);}return updatedRun;@@ -462,6 +465,7 @@ export const callTask = async (taskId, input, options = {}) => {runId: run.id,token,waitSecs,+ taskId,});// Finish if output is not requested or run haven't finished.