refactor: remove dead code
[poolifier.git] / src / pools / selection-strategies / worker-choice-strategy-context.ts
index a3e3379c9ac461fc7cd16c2d32bb8735ca2d50ff..7c7574fa7a39f55913282a60bd0becf35e88b6fc 100644 (file)
@@ -168,7 +168,7 @@ export class WorkerChoiceStrategyContext<
    * Executes the worker choice strategy in the context algorithm.
    *
    * @returns The key of the worker node.
-   * @throws {@link https://nodejs.org/api/errors.html#class-error} If the worker node key is null or undefined.
+   * @throws {@link https://nodejs.org/api/errors.html#class-error} If after configured retries the worker node key is null or undefined .
    */
   public execute (): number {
     const workerNodeKey = (
@@ -183,7 +183,7 @@ export class WorkerChoiceStrategyContext<
       this.choiceRetriesCount++
       return this.execute()
     } else if (workerNodeKey == null) {
-      throw new TypeError(
+      throw new Error(
         `Worker node key chosen is null or undefined after ${this.choiceRetriesCount} retries`
       )
     }