refactor: refine error message at pool instantiation inside a worker
[poolifier.git] / src / pools / abstract-pool.ts
index 8332d31aefb2a9d91fac99bcea3a1d3690883be6..5633613ecebdda8cb763c7922588ebc504be4fc7 100644 (file)
@@ -106,7 +106,9 @@ export abstract class AbstractPool<
     protected readonly opts: PoolOptions<Worker>
   ) {
     if (!this.isMain()) {
-      throw new Error('Cannot start a pool from a worker!')
+      throw new Error(
+        'Cannot start a pool from the same worker type as the current pool one'
+      )
     }
     this.checkNumberOfWorkers(this.numberOfWorkers)
     this.checkFilePath(this.filePath)