X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fworker-choice-strategy-context.ts;h=7c7574fa7a39f55913282a60bd0becf35e88b6fc;hb=172ed3de085bd6c59ffe877d48d4c49eeaffa8c7;hp=a3e3379c9ac461fc7cd16c2d32bb8735ca2d50ff;hpb=0ffa432eaff319902a2657c5e44374ea109cfb87;p=poolifier.git diff --git a/src/pools/selection-strategies/worker-choice-strategy-context.ts b/src/pools/selection-strategies/worker-choice-strategy-context.ts index a3e3379c..7c7574fa 100644 --- a/src/pools/selection-strategies/worker-choice-strategy-context.ts +++ b/src/pools/selection-strategies/worker-choice-strategy-context.ts @@ -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` ) }