Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Fix timeout error message race condition for ENG-3372 (#2144)

devin-ai-integration[bot]8309eb8be3f1
diff --git a/apps/api/src/scraper/scrapeURL/index.ts b/apps/api/src/scraper/scrapeURL/index.ts
index e2937ae44..c9f6e8a8c 100644
--- a/apps/api/src/scraper/scrapeURL/index.ts
+++ b/apps/api/src/scraper/scrapeURL/index.ts
@@ -491,8 +491,12 @@ async function scrapeURLLoop(meta: Meta): Promise<ScrapeUrlResponse> {
meta.abort.throwIfAborted();
// Fallback error if above doesn't throw
+ const usingDefaultTimeout =
+ meta.abort.scrapeTimeout() === undefined;
throw new ScrapeJobTimeoutError(
- "Scrape timed out due to maximum length of 5 minutes",
+ usingDefaultTimeout
+ ? "Scrape timed out due to maximum length of 5 minutes"
+ : "Scrape timed out",
);
} catch (error) {
reject(error);