File tree Expand file tree Collapse file tree 5 files changed +4
-34
lines changed Expand file tree Collapse file tree 5 files changed +4
-34
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import {
1717} from '../constants' ;
1818import {
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
Original file line number Diff line number Diff 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 */
10781050export interface MongoNetworkErrorOptions {
10791051 /** Indicates the timeout happened before a connection handshake completed */
Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ export {
4545export { ClientEncryption } from './client-side-encryption/client_encryption' ;
4646export { ChangeStreamCursor } from './cursor/change_stream_cursor' ;
4747export {
48- ConnectionPoolClosedError ,
4948 MongoAPIError ,
5049 MongoAWSError ,
5150 MongoAzureError ,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const { Writable } = require('stream');
1111const { once, on } = require ( 'events' ) ;
1212const { setTimeout } = require ( 'timers' ) ;
1313const { ReadPreference } = require ( '../../mongodb' ) ;
14- const { ServerType, ConnectionPoolClosedError } = require ( '../../mongodb' ) ;
14+ const { ServerType, MongoClientClosedError } = require ( '../../mongodb' ) ;
1515const { formatSort } = require ( '../../mongodb' ) ;
1616
1717describe ( '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 }
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ const EXPECTED_EXPORTS = [
3636 'ConnectionClosedEvent' ,
3737 'ConnectionCreatedEvent' ,
3838 'ConnectionPoolClearedEvent' ,
39- 'ConnectionPoolClosedError' ,
4039 'ConnectionPoolClosedEvent' ,
4140 'ConnectionPoolCreatedEvent' ,
4241 'ConnectionPoolMonitoringEvent' ,
You can’t perform that action at this time.
0 commit comments