File tree 5 files changed +4
-34
lines changed
5 files changed +4
-34
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import {
17
17
} from '../constants' ;
18
18
import {
19
19
type AnyError ,
20
- ConnectionPoolClosedError ,
20
+ MongoClientClosedError ,
21
21
type MongoError ,
22
22
MongoInvalidArgumentError ,
23
23
MongoMissingCredentialsError ,
@@ -496,7 +496,7 @@ export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
496
496
ConnectionPool . CONNECTION_CLOSED ,
497
497
new ConnectionClosedEvent ( this , conn , 'poolClosed' )
498
498
) ;
499
- conn . onError ( new ConnectionPoolClosedError ( ) ) ;
499
+ conn . onError ( new MongoClientClosedError ( ) ) ;
500
500
}
501
501
}
502
502
Original file line number Diff line number Diff line change @@ -1046,34 +1046,6 @@ export class MongoClientClosedError extends MongoAPIError {
1046
1046
}
1047
1047
}
1048
1048
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
-
1077
1049
/** @public */
1078
1050
export interface MongoNetworkErrorOptions {
1079
1051
/** Indicates the timeout happened before a connection handshake completed */
Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ export {
45
45
export { ClientEncryption } from './client-side-encryption/client_encryption' ;
46
46
export { ChangeStreamCursor } from './cursor/change_stream_cursor' ;
47
47
export {
48
- ConnectionPoolClosedError ,
49
48
MongoAPIError ,
50
49
MongoAWSError ,
51
50
MongoAzureError ,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const { Writable } = require('stream');
11
11
const { once, on } = require ( 'events' ) ;
12
12
const { setTimeout } = require ( 'timers' ) ;
13
13
const { ReadPreference } = require ( '../../mongodb' ) ;
14
- const { ServerType, ConnectionPoolClosedError } = require ( '../../mongodb' ) ;
14
+ const { ServerType, MongoClientClosedError } = require ( '../../mongodb' ) ;
15
15
const { formatSort } = require ( '../../mongodb' ) ;
16
16
17
17
describe ( 'Cursor' , function ( ) {
@@ -1873,7 +1873,7 @@ describe('Cursor', function () {
1873
1873
1874
1874
const error = await rejectedEarlyBecauseClientClosed ;
1875
1875
if ( this . configuration . topologyType === 'LoadBalanced' ) {
1876
- expect ( error ) . to . be . instanceOf ( ConnectionPoolClosedError ) ;
1876
+ expect ( error ) . to . be . instanceOf ( MongoClientClosedError ) ;
1877
1877
} else {
1878
1878
expect ( error ) . to . be . null ;
1879
1879
}
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ const EXPECTED_EXPORTS = [
36
36
'ConnectionClosedEvent' ,
37
37
'ConnectionCreatedEvent' ,
38
38
'ConnectionPoolClearedEvent' ,
39
- 'ConnectionPoolClosedError' ,
40
39
'ConnectionPoolClosedEvent' ,
41
40
'ConnectionPoolCreatedEvent' ,
42
41
'ConnectionPoolMonitoringEvent' ,
You can’t perform that action at this time.
0 commit comments