Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
fix(api/v1/types): depth check throws error if URL is invalid (#1821)
Gergő Móricz6849ab16bba4
diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.tsindex 5de6eb3c8..6322f0c16 100644--- a/apps/api/src/controllers/v1/types.ts+++ b/apps/api/src/controllers/v1/types.ts@@ -697,8 +697,12 @@ export const crawlRequestSchema = crawlerOptions.refine((x) => waitForRefine(x.scrapeOptions), waitForRefineOpts).refine((data) => {- const urlDepth = getURLDepth(data.url);- return urlDepth <= data.maxDepth;+ try {+ const urlDepth = getURLDepth(data.url);+ return urlDepth <= data.maxDepth;+ } catch (e) {+ return false;+ }},{message: "URL depth exceeds the specified maxDepth",