@@ -245,42 +245,93 @@ export class MongoParseError extends MongoDriverError {
245
245
}
246
246
}
247
247
248
+ /**
249
+ * An error generated when the user misuses the driver API
250
+ *
251
+ * @privateRemarks
252
+ * Should **never** be directly instantiated
253
+ *
254
+ * @public
255
+ * @category Error
256
+ */
257
+
248
258
export class MongoAPIError extends MongoDriverError {
249
- constructor ( message : string ) {
259
+ protected constructor ( message : string ) {
250
260
super ( message ) ;
251
- this . name = 'MongoAPIError' ;
261
+ }
262
+
263
+ get name ( ) : string {
264
+ return 'MongoAPIError' ;
252
265
}
253
266
}
254
267
268
+ /**
269
+ * An error generated when the user supplies malformed or unexpected arguments
270
+ * or when a required argument or field is not provided.
271
+ *
272
+ *
273
+ * @public
274
+ * @category Error
275
+ */
255
276
export class MongoInvalidArgumentError extends MongoAPIError {
256
277
constructor ( message : string ) {
257
278
super ( message ) ;
258
- this . name = 'MongoInvalidArgumentError' ;
279
+ }
280
+
281
+ get name ( ) : string {
282
+ return 'MongoInvalidArgumentError' ;
259
283
}
260
284
}
261
285
286
+ /**
287
+ * An error generated when a feature that is not enabled or allowed for the current server
288
+ * configuration is used
289
+ *
290
+ *
291
+ * @public
292
+ * @category Error
293
+ */
262
294
export class MongoCompatibilityError extends MongoAPIError {
263
295
constructor ( message : string ) {
264
296
super ( message ) ;
265
- this . name = 'MongoCompatibilityError' ;
266
297
}
267
- }
268
- export class MongoClientInstantiationError extends MongoAPIError {
269
- constructor ( message : string ) {
270
- super ( message ) ;
271
- this . name = 'MongoClientInstantiationError' ;
298
+
299
+ get name ( ) : string {
300
+ return 'MongoCompatibilityError' ;
272
301
}
273
302
}
303
+
304
+ /**
305
+ * An error generated when the user fails to provide authentication credentials before attempting
306
+ * to connect to a mongo server instance.
307
+ *
308
+ *
309
+ * @public
310
+ * @category Error
311
+ */
274
312
export class MongoMissingCredentialsError extends MongoAPIError {
275
313
constructor ( message : string ) {
276
314
super ( message ) ;
277
- this . name = 'MongoMissingCredentialsError' ;
315
+ }
316
+
317
+ get name ( ) : string {
318
+ return 'MongoMissingCredentialsError' ;
278
319
}
279
320
}
321
+
322
+ /**
323
+ * An error generated when a required module or dependency is not present in the local environment
324
+ *
325
+ * @public
326
+ * @category Error
327
+ */
280
328
export class MongoMissingDependencyError extends MongoAPIError {
281
329
constructor ( message : string ) {
282
330
super ( message ) ;
283
- this . name = 'MongoMissingDependencyError' ;
331
+ }
332
+
333
+ get name ( ) : string {
334
+ return 'MongoMissingDependencyError' ;
284
335
}
285
336
}
286
337
/**
0 commit comments