fix(runWebScraper): proper error handling

This commit is contained in:
Gergő Móricz 2024-12-16 22:24:00 +01:00
parent 2de659d810
commit 139e2c9a05

View File

@ -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