mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
Nick: fixed error handling for v0 scrape
This commit is contained in:
parent
0690cfeaad
commit
3fc5ce17d2
|
@ -285,11 +285,19 @@ export async function scrapeController(req: Request, res: Response) {
|
|||
} catch (error) {
|
||||
Sentry.captureException(error);
|
||||
Logger.error(error);
|
||||
return res.status(500).json({
|
||||
error:
|
||||
if (typeof error === "string" && error.startsWith("{\"type\":\"all\",")) {
|
||||
return res.status(500).json({
|
||||
success: false,
|
||||
error: "All scraping methods failed for URL: " + req.body.url,
|
||||
details: JSON.parse(error).errors as string[],
|
||||
});
|
||||
} else {
|
||||
return res.status(500).json({
|
||||
error:
|
||||
typeof error === "string"
|
||||
? error
|
||||
: error?.message ?? "Internal Server Error",
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user