From 25e94ffd285a59597adb600b87ce17f82de836da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Thu, 7 Nov 2024 23:21:07 +0100 Subject: [PATCH] fix(scrapeURL): do not submit LLM schema errors to Sentry --- apps/api/src/scraper/scrapeURL/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/api/src/scraper/scrapeURL/index.ts b/apps/api/src/scraper/scrapeURL/index.ts index 738c8380..27a8f579 100644 --- a/apps/api/src/scraper/scrapeURL/index.ts +++ b/apps/api/src/scraper/scrapeURL/index.ts @@ -304,6 +304,9 @@ export async function scrapeURL( } else if (error instanceof LLMRefusalError) { meta.logger.warn("scrapeURL: LLM refused to extract content", { error }); results = error.results!; + } else if (error instanceof Error && error.message.includes("Invalid schema for response_format")) { // TODO: seperate into custom error + meta.logger.warn("scrapeURL: LLM schema error", { error }); + // TODO: results? } else { Sentry.captureException(error); meta.logger.error("scrapeURL: Unexpected error happened", { error });