Skip to content

Commit 6c4a056

Browse files
committed
chore: Replace some MongoDriverError instances
1 parent 3435546 commit 6c4a056

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/mongo_client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
556556
}
557557

558558
if (callback == null) {
559-
throw new MongoDriverError('Missing required callback parameter');
559+
throw new MongoInvalidArgumentError('Missing required callback parameter');
560560
}
561561

562562
const session = this.startSession(options);

src/sessions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
269269
topologyMaxWireVersion != null &&
270270
topologyMaxWireVersion < minWireVersionForShardedTransactions
271271
) {
272-
throw new MongoDriverError(
272+
throw new MongoCompatibilityError(
273273
'Transactions are not supported on sharded clusters in MongoDB < 4.2.'
274274
);
275275
}

0 commit comments

Comments
 (0)