Skip to content

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

fix(runWebScraper): proper error handling

Gergő Móricz139e2c9a0591
diff --git a/apps/api/src/main/runWebScraper.ts b/apps/api/src/main/runWebScraper.ts
index 83e899bb1..5fb574d4a 100644
--- a/apps/api/src/main/runWebScraper.ts
+++ b/apps/api/src/main/runWebScraper.ts
@@ -96,7 +96,6 @@ export async function runWebScraper({
...internalOptions,
});
if (!response.success) {
- error = response.error;
if (response.error instanceof Error) {
throw response.error;
} else {
@@ -124,7 +123,8 @@ export async function runWebScraper({
// status code is good -- do not attempt retry
break;
}
- } catch (error) {
+ } catch (_error) {
+ error = _error;
engines =
response !== undefined
? response.engines