mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 03:32:22 +08:00
fix(search): handle scrape timeouts on search
Fixes FIRECRAWL-SCRAPER-JS-15
This commit is contained in:
parent
14fa75cae6
commit
508568f943
|
@ -186,6 +186,10 @@ export async function searchController(req: Request, res: Response) {
|
|||
});
|
||||
return res.status(result.returnCode).json(result);
|
||||
} catch (error) {
|
||||
if (error instanceof Error && error.message.startsWith("Job wait")) {
|
||||
return res.status(408).json({ error: "Request timed out" });
|
||||
}
|
||||
|
||||
Sentry.captureException(error);
|
||||
Logger.error(error);
|
||||
return res.status(500).json({ error: error.message });
|
||||
|
|
Loading…
Reference in New Issue
Block a user