* **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)
| 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'; |
nothing calls this directly
no test coverage detected