Skip to content

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

add file size limit to error (#4247)

rowinsg84665df1a6f9
diff --git a/apps/api/src/scraper/scrapeURL/engines/fire-engine/checkStatus.ts b/apps/api/src/scraper/scrapeURL/engines/fire-engine/checkStatus.ts
index f27516283..2a8d78434 100644
--- a/apps/api/src/scraper/scrapeURL/engines/fire-engine/checkStatus.ts
+++ b/apps/api/src/scraper/scrapeURL/engines/fire-engine/checkStatus.ts
@@ -235,10 +235,9 @@ export async function fireEngineCheckStatus(
);
} else if (
typeof status.error === "string" &&
- (status.error.includes("File size exceeds") ||
- status.error.includes("File exceeds size limit"))
+ status.error.includes("File exceeds size limit")
) {
- throw new UnsupportedFileError("File exceeds size limit");
+ throw new UnsupportedFileError(status.error);
} else if (
typeof status.error === "string" &&
status.error.includes("failed to finish without timing out")
diff --git a/apps/api/src/scraper/scrapeURL/engines/fire-engine/scrape.ts b/apps/api/src/scraper/scrapeURL/engines/fire-engine/scrape.ts
index 6eaee9319..dddaaf509 100644
--- a/apps/api/src/scraper/scrapeURL/engines/fire-engine/scrape.ts
+++ b/apps/api/src/scraper/scrapeURL/engines/fire-engine/scrape.ts
@@ -271,10 +271,9 @@ export async function fireEngineScrape<
);
} else if (
typeof status.error === "string" &&
- (status.error.includes("File size exceeds") ||
- status.error.includes("File exceeds size limit"))
+ status.error.includes("File exceeds size limit")
) {
- throw new UnsupportedFileError("File exceeds size limit");
+ throw new UnsupportedFileError(status.error);
} else if (
typeof status.error === "string" &&
status.error.includes("failed to finish without timing out")