fix: catch FlareSolverr fallback errors in fetchSourceFurnidata
Previously, if FlareSolverr itself failed (timeout, connection error), the error would propagate as generic 'network error'. Now it throws a descriptive error message.
This commit is contained in:
1 parent
1fd6f7146b
commit
a2b0752076
1 file changed
+7
-1
@@ -104,7 +104,13 @@ export async function fetchSourceFurnidata(
|
|||||||
body = await fetchWithFlareSolver(url);
|
body = await fetchWithFlareSolver(url);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
body = await fetchWithFlareSolver(url);
|
try {
|
||||||
|
body = await fetchWithFlareSolver(url);
|
||||||
|
} catch (err) {
|
||||||
|
throw new Error(
|
||||||
|
`FlareSolverr fallback failed for ${url}: ${(err as Error).message}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (body.trimStart().startsWith("<")) {
|
if (body.trimStart().startsWith("<")) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
Reference in new issue
Block a user