X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Fabstract-worker.ts;h=63d14b2ed2dbd2a592451a7d8363564f8d6c9fbe;hb=eb7bf7441d410ca5d9ff9bb08f191ef22399371c;hp=0646a9bfa0e423bd466ccc16efeba8b4782067c7;hpb=76aa2b0f39bd376383f2fdc79046328693719590;p=poolifier.git diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 0646a9bf..63d14b2e 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -206,7 +206,7 @@ export abstract class AbstractWorker< * Handles an error and convert it to a string so it can be sent back to the main worker. * * @param e - The error raised by the worker. - * @returns Message of the error. + * @returns The error message. */ protected handleError (e: Error | string): string { return e as string @@ -236,10 +236,10 @@ export abstract class AbstractWorker< const err = this.handleError(e as Error) this.sendToMainWorker({ taskError: { + workerId: this.id, message: err, data: message.data }, - workerId: this.id, id: message.id }) } finally { @@ -273,10 +273,10 @@ export abstract class AbstractWorker< const err = this.handleError(e as Error) this.sendToMainWorker({ taskError: { + workerId: this.id, message: err, data: message.data }, - workerId: this.id, id: message.id }) })