perf: drastically reduce worker nodes array lookups
[poolifier.git] / src / pools / selection-strategies / worker-choice-strategy-context.ts
index 28e3af081db65595fb985f39e30a930a43d70620..122774dd0e48c157d5d7c7ce5bdc4ea590281087 100644 (file)
@@ -171,7 +171,7 @@ export class WorkerChoiceStrategyContext<
       ) as IWorkerChoiceStrategy
     ).choose()
     if (workerNodeKey == null) {
-      throw new Error('Worker node key chosen is null or undefined')
+      throw new TypeError('Worker node key chosen is null or undefined')
     }
     return workerNodeKey
   }