Simplify WorkerUtils.defaultErrorHandler usage in WorkerSet
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 16 Sep 2022 17:42:12 +0000 (19:42 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 16 Sep 2022 17:42:12 +0000 (19:42 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerSet.ts

index 2fed62f5669828e0e18d3abf6bcf4e245d74fbf0..1da58e9ec0c81d78cde805217c293d529ecc584c 100644 (file)
@@ -96,9 +96,7 @@ export default class WorkerSet extends WorkerAbstract<WorkerData> {
         /* This is intentional */
       });
     });
-    worker.on('error', (error) => {
-      WorkerUtils.defaultErrorHandler(error);
-    });
+    worker.on('error', WorkerUtils.defaultErrorHandler);
     worker.on('exit', (code) => {
       WorkerUtils.defaultExitHandler(code);
       this.workerSet.delete(this.getWorkerSetElementByWorker(worker));