feat: improve error handling in web search

This commit is contained in:
AnotiaWang
2025-02-14 10:30:02 +08:00
parent 8d27f70c3e
commit e60890e286
5 changed files with 49 additions and 11 deletions

View File

@ -381,9 +381,20 @@ export async function deepResearch({
}
}
} catch (e: any) {
throw new Error(
`Error searching for ${searchQuery.query}, depth ${currentDepth}\nMessage: ${e.message}`,
const id = childNodeId(nodeId, i)
console.error(
`Error in node ${id} for query ${searchQuery.query}`,
e,
)
onProgress({
type: 'error',
message: e.message,
nodeId: id,
})
return {
learnings: [],
visitedUrls: [],
}
}
}),
),