aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workers/crawlerWorker.ts
diff options
context:
space:
mode:
authorkamtschatka <simon.schatka@gmx.at>2024-09-26 23:39:21 +0200
committerGitHub <noreply@github.com>2024-09-26 22:39:21 +0100
commit7cc2f8b3d4afbee28e6f7e19c086077873bc7a2f (patch)
tree3067c31793ce5d20716a6f4e07018566fdeb8f88 /apps/workers/crawlerWorker.ts
parent4db50c234fb0da8747b902a7c1e551cc54451f4c (diff)
downloadkarakeep-7cc2f8b3d4afbee28e6f7e19c086077873bc7a2f.tar.zst
fix(workers): Log stacktrace on worker error. #424 (#429)
extended logging when an exception occurrs, so it is possible to see the stacktrace of a failed execution
Diffstat (limited to 'apps/workers/crawlerWorker.ts')
-rw-r--r--apps/workers/crawlerWorker.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/workers/crawlerWorker.ts b/apps/workers/crawlerWorker.ts
index 76348821..49e9495d 100644
--- a/apps/workers/crawlerWorker.ts
+++ b/apps/workers/crawlerWorker.ts
@@ -172,7 +172,9 @@ export class CrawlerWorker {
},
onError: async (job) => {
const jobId = job?.id ?? "unknown";
- logger.error(`[Crawler][${jobId}] Crawling job failed: ${job.error}`);
+ logger.error(
+ `[Crawler][${jobId}] Crawling job failed: ${job.error}\n${job.error.stack}`,
+ );
const bookmarkId = job.data?.bookmarkId;
if (bookmarkId) {
await changeBookmarkStatus(bookmarkId, "failure");