Skip to content

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

fix(v1/map): add wrapper around tryGetSitemap

Gergő Móricz5a039e7b64c0
diff --git a/apps/api/src/controllers/v1/map.ts b/apps/api/src/controllers/v1/map.ts
index a50357d1c..3d6c5541d 100644
--- a/apps/api/src/controllers/v1/map.ts
+++ b/apps/api/src/controllers/v1/map.ts
@@ -171,9 +171,13 @@ export async function getMapResults({
(sitemapIndexResult.urls.length < 100 ||
new Date(sitemapIndexResult.lastUpdated) < twoDaysAgo)
) {
- await crawler.tryGetSitemap(urls => {
- links.push(...urls);
- }, true, false, 30000);
+ try {
+ await crawler.tryGetSitemap(urls => {
+ links.push(...urls);
+ }, true, false, 30000);
+ } catch (e) {
+ logger.warn("tryGetSitemap threw an error", { error: e });
+ }
}
if (!cachedResult) {