MCPcopy
hub / github.com/mongodb/node-mongodb-native / constructor

Method constructor

src/cmap/errors.ts:52–60  ·  view source on GitHub ↗

* **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)

Source from the content-addressed store, hash-verified

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';

Callers

nothing calls this directly

Calls 1

addErrorLabelMethod · 0.80

Tested by

no test coverage detected