X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fabstract-pool.ts;h=7be2cef51c8f11646b5f43174de7abe3ea43a82c;hb=9eae3c69ca545dc5e4807e2ae059f850e2bd6f9f;hp=3d10391c17748cdd63473c4afae7630665023008;hpb=619e0f0417560f44a99f4508a8f314db54173c0c;p=poolifier.git diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 3d10391c..7be2cef5 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -858,6 +858,11 @@ export abstract class AbstractPool< /** @inheritDoc */ public async removeTaskFunction (name: string): Promise { + if (!this.taskFunctions.has(name)) { + throw new Error( + 'Cannot remove a task function that does not exist on the pool side' + ) + } this.taskFunctions.delete(name) return await this.sendTaskFunctionOperationToWorkers({ taskFunctionOperation: 'remove',