From ee9f0ad39b47fe80bb08d159024dad0fae81f6c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 14 Aug 2023 21:44:00 +0200 Subject: [PATCH] refactor: refine worker message handling error messsage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/worker/abstract-worker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 5a61f1cf..6bf84b87 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -301,7 +301,9 @@ export abstract class AbstractWorker< if (this.isMain) { throw new Error('Cannot handle message to worker in main worker') } else if (message.workerId != null && message.workerId !== this.id) { - throw new Error('Message worker id does not match the worker id') + throw new Error( + `Message worker id ${message.workerId} does not match the worker id ${this.id}` + ) } else if (message.workerId === this.id) { if (message.statistics != null) { // Statistics message received -- 2.34.1