* **Do not use this constructor!** * * Meant for internal use only. * * @remarks * This class is only meant to be constructed within the driver. This constructor is * not subject to semantic versioning compatibility guarantees and may change at any time. * * @public
(pool: ConnectionPool, message?: string)
| 50 | * @public |
| 51 | **/ |
| 52 | constructor(pool: ConnectionPool, message?: string) { |
| 53 | const errorMessage = message |
| 54 | ? message |
| 55 | : `Connection pool for ${pool.address} was cleared because another operation failed with: "${pool.serverError?.message}"`; |
| 56 | super(errorMessage, pool.serverError ? { cause: pool.serverError } : undefined); |
| 57 | this.address = pool.address; |
| 58 | |
| 59 | this.addErrorLabel(MongoErrorLabel.PoolRequestedRetry); |
| 60 | } |
| 61 | |
| 62 | override get name(): string { |
| 63 | return 'MongoPoolClearedError'; |
nothing calls this directly
no test coverage detected