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

Method constructor

src/error.ts:1282–1296  ·  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

(message: string, reason: TopologyDescription)

Source from the content-addressed store, hash-verified

1280 * @public
1281 **/
1282 constructor(message: string, reason: TopologyDescription) {
1283 if (reason && reason.error) {
1284 super(MongoError.buildErrorMessage(reason.error.message || reason.error), {
1285 cause: reason.error
1286 });
1287 } else {
1288 super(message);
1289 }
1290
1291 if (reason) {
1292 this.reason = reason;
1293 }
1294
1295 this.code = reason.error?.code;
1296 }
1297
1298 override get name(): string {
1299 return 'MongoSystemError';

Callers

nothing calls this directly

Calls 1

buildErrorMessageMethod · 0.80

Tested by

no test coverage detected