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
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
this.opts.killHandler?.() as void
this.sendToMainWorker({ kill: 'success', workerId: this.id })
- } catch (error) {
+ } catch {
this.sendToMainWorker({ kill: 'failure', workerId: this.id })
} finally {
this.emitDestroy()