Response = unknown
> extends AsyncResource {
/**
- * Worker Id.
+ * Worker id.
*/
protected abstract id: number
/**
* 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
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 {
const err = this.handleError(e as Error)
this.sendToMainWorker({
taskError: {
+ workerId: this.id,
message: err,
data: message.data
},
- workerId: this.id,
id: message.id
})
})