Add check to see if existing service/method exists to logger statement

This commit is contained in:
Alex Holliday
2024-11-13 10:33:46 +08:00
parent 59cbd1178b
commit 41370c8d04
+3 -2
View File
@@ -178,10 +178,11 @@ class JobQueue {
prevStatus,
});
} catch (error) {
console.log(error.service);
this.logger.error({
message: error.message,
service: SERVICE_NAME,
method: "createWorker",
service: error.service ?? SERVICE_NAME,
method: error.method ?? "createJobHandler",
details: `Error processing job ${job.id}: ${error.message}`,
stack: error.stack,
});