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

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