- this.port = message.port
- this.port.on('message', this.messageListener.bind(this))
- this.sendToMainWorker({ ready: true, workerId: this.id })
+ try {
+ this.port = message.port
+ this.port.on('message', this.messageListener.bind(this))
+ this.sendToMainWorker({
+ ready: true,
+ taskFunctionsProperties: this.listTaskFunctionsProperties(),
+ })
+ } catch {
+ this.sendToMainWorker({
+ ready: false,
+ taskFunctionsProperties: this.listTaskFunctionsProperties(),
+ })
+ }