Skip to content

Commit

Permalink
Keep MongoError for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
dariakp committed May 28, 2021
1 parent 3c815a9 commit a325f93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cmap/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ function messageHandler(conn: Connection) {
// Pass in the entire description because it has BSON parsing options
message.parse(operationDescription);
} catch (err) {
callback(new MongoDriverError(err));
callback(new MongoError(err));
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/operations/rename.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineAspects, Aspect } from './operation';
import type { Server } from '../sdam/server';
import { Collection } from '../collection';
import type { CommandOperationOptions } from './command';
import { MongoDriverError, MongoServerError } from '../error';
import { MongoError, MongoServerError } from '../error';
import type { ClientSession } from '../sessions';
import type { Document } from 'bson';

Expand Down Expand Up @@ -52,7 +52,7 @@ export class RenameOperation extends RunAdminCommandOperation {
try {
newColl = new Collection(coll.s.db, this.newName, coll.s.options);
} catch (err) {
return callback(new MongoDriverError(err));
return callback(new MongoError(err));
}

return callback(undefined, newColl);
Expand Down

0 comments on commit a325f93

Please sign in to comment.