Skip to content

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

fix(branding): improve error messages for PDFs and documents (#2776)

Abimael Martelle374660cd308
diff --git a/apps/api/src/scraper/scrapeURL/engines/index.ts b/apps/api/src/scraper/scrapeURL/engines/index.ts
index e9197ec47..7a897cc1b 100644
--- a/apps/api/src/scraper/scrapeURL/engines/index.ts
+++ b/apps/api/src/scraper/scrapeURL/engines/index.ts
@@ -609,9 +609,16 @@ export async function buildFallbackList(meta: Meta): Promise<
f => !f.unsupportedFeatures.has("branding"),
);
if (!hasCDPEngine) {
- throw new Error(
- "Branding extraction requires Chrome CDP (fire-engine). ",
- );
+ if (meta.featureFlags.has("pdf")) {
+ throw new Error(
+ "Branding extraction is only supported for HTML web pages. PDFs are not supported.",
+ );
+ } else if (meta.featureFlags.has("document")) {
+ throw new Error(
+ "Branding extraction is only supported for HTML web pages. Documents (docx, xlsx, etc.) are not supported.",
+ );
+ }
+ throw new Error("Branding extraction requires Chrome CDP (fire-engine).");
}
}