@@ -5,7 +5,7 @@ import { OP_QUERY, OP_GETMORE, OP_KILL_CURSORS, OP_MSG } from './wire_protocol/c
55import type { Long , Document , BSONSerializeOptions } from '../bson' ;
66import type { ClientSession } from '../sessions' ;
77import type { CommandOptions } from './connection' ;
8- import { MongoDriverError , MongoInvalidArgumentError } from '../error' ;
8+ import { MongoRuntimeError , MongoInvalidArgumentError } from '../error' ;
99
1010// Incrementing request id
1111let _requestId = 0 ;
@@ -78,14 +78,14 @@ export class Query {
7878 constructor ( ns : string , query : Document , options : OpQueryOptions ) {
7979 // Basic options needed to be passed in
8080 // TODO(NODE-3483): Replace with MongoCommandError
81- if ( ns == null ) throw new MongoDriverError ( 'Namespace must be specified for query' ) ;
81+ if ( ns == null ) throw new MongoRuntimeError ( 'Namespace must be specified for query' ) ;
8282 // TODO(NODE-3483): Replace with MongoCommandError
83- if ( query == null ) throw new MongoDriverError ( 'A query document must be specified for query' ) ;
83+ if ( query == null ) throw new MongoRuntimeError ( 'A query document must be specified for query' ) ;
8484
8585 // Validate that we are not passing 0x00 in the collection name
8686 if ( ns . indexOf ( '\x00' ) !== - 1 ) {
8787 // TODO(NODE-3483): Use MongoNamespace static method
88- throw new MongoDriverError ( 'Namespace cannot contain a null character' ) ;
88+ throw new MongoRuntimeError ( 'Namespace cannot contain a null character' ) ;
8989 }
9090
9191 // Basic options
@@ -858,7 +858,7 @@ export class BinMsg {
858858 // It was decided that no driver makes use of payload type 1
859859
860860 // TODO(NODE-3483): Replace with MongoDeprecationError
861- throw new MongoDriverError ( 'OP_MSG Payload Type 1 detected unsupported protocol' ) ;
861+ throw new MongoRuntimeError ( 'OP_MSG Payload Type 1 detected unsupported protocol' ) ;
862862 }
863863 }
864864
0 commit comments