feat(v1/scrape): add more context to timeout logs

This commit is contained in:
Gergő Móricz 2024-12-16 22:42:51 +01:00
parent 139e2c9a05
commit 0013bdfcb4

View File

@ -60,7 +60,7 @@ export async function scrapeController(
try { try {
doc = await waitForJob<Document>(jobId, timeout + totalWait); // TODO: better types for this doc = await waitForJob<Document>(jobId, timeout + totalWait); // TODO: better types for this
} catch (e) { } catch (e) {
logger.error(`Error in scrapeController: ${e}`); logger.error(`Error in scrapeController: ${e}`, { jobId, scrapeId: jobId, startTime });
if ( if (
e instanceof Error && e instanceof Error &&
(e.message.startsWith("Job wait") || e.message === "timeout") (e.message.startsWith("Job wait") || e.message === "timeout")