Skip to content

Commit 0b418bb

Browse files
committed
chore: remove ConnectionPoolClosedError
1 parent b874616 commit 0b418bb

File tree

5 files changed

+4
-34
lines changed

5 files changed

+4
-34
lines changed

src/cmap/connection_pool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
} from '../constants';
1818
import {
1919
type AnyError,
20-
ConnectionPoolClosedError,
20+
MongoClientClosedError,
2121
type MongoError,
2222
MongoInvalidArgumentError,
2323
MongoMissingCredentialsError,
@@ -496,7 +496,7 @@ export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
496496
ConnectionPool.CONNECTION_CLOSED,
497497
new ConnectionClosedEvent(this, conn, 'poolClosed')
498498
);
499-
conn.onError(new ConnectionPoolClosedError());
499+
conn.onError(new MongoClientClosedError());
500500
}
501501
}
502502

src/error.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,34 +1046,6 @@ export class MongoClientClosedError extends MongoAPIError {
10461046
}
10471047
}
10481048

1049-
/**
1050-
* An error generated when a ConnectionPool is closed and async
1051-
* operations are interrupted.
1052-
*
1053-
* @public
1054-
* @category Error
1055-
*/
1056-
export class ConnectionPoolClosedError extends MongoAPIError {
1057-
/**
1058-
* **Do not use this constructor!**
1059-
*
1060-
* Meant for internal use only.
1061-
*
1062-
* @remarks
1063-
* This class is only meant to be constructed within the driver. This constructor is
1064-
* not subject to semantic versioning compatibility guarantees and may change at any time.
1065-
*
1066-
* @public
1067-
**/
1068-
constructor(message = 'ConnectionPool is closed') {
1069-
super(message);
1070-
}
1071-
1072-
override get name(): string {
1073-
return 'ConnectionPoolClosedError';
1074-
}
1075-
}
1076-
10771049
/** @public */
10781050
export interface MongoNetworkErrorOptions {
10791051
/** Indicates the timeout happened before a connection handshake completed */

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export {
4545
export { ClientEncryption } from './client-side-encryption/client_encryption';
4646
export { ChangeStreamCursor } from './cursor/change_stream_cursor';
4747
export {
48-
ConnectionPoolClosedError,
4948
MongoAPIError,
5049
MongoAWSError,
5150
MongoAzureError,

test/integration/crud/misc_cursors.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { Writable } = require('stream');
1111
const { once, on } = require('events');
1212
const { setTimeout } = require('timers');
1313
const { ReadPreference } = require('../../mongodb');
14-
const { ServerType, ConnectionPoolClosedError } = require('../../mongodb');
14+
const { ServerType, MongoClientClosedError } = require('../../mongodb');
1515
const { formatSort } = require('../../mongodb');
1616

1717
describe('Cursor', function () {
@@ -1873,7 +1873,7 @@ describe('Cursor', function () {
18731873

18741874
const error = await rejectedEarlyBecauseClientClosed;
18751875
if (this.configuration.topologyType === 'LoadBalanced') {
1876-
expect(error).to.be.instanceOf(ConnectionPoolClosedError);
1876+
expect(error).to.be.instanceOf(MongoClientClosedError);
18771877
} else {
18781878
expect(error).to.be.null;
18791879
}

test/unit/index.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const EXPECTED_EXPORTS = [
3636
'ConnectionClosedEvent',
3737
'ConnectionCreatedEvent',
3838
'ConnectionPoolClearedEvent',
39-
'ConnectionPoolClosedError',
4039
'ConnectionPoolClosedEvent',
4140
'ConnectionPoolCreatedEvent',
4241
'ConnectionPoolMonitoringEvent',

0 commit comments

Comments
 (0)