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 e486fd0 commit 296036d
Showing 1 changed file with 2 additions and 2 deletions.
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 296036d

Please sign in to comment.