Skip to content

Commit

Permalink
Remove unused string option to MongoServerError constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
dariakp committed Jun 4, 2021
1 parent 7d0e1b4 commit 8842ab9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ export class MongoServerError extends MongoError {
codeName?: string;
writeConcernError?: Document;

constructor(message: string | Error | ErrorDescription) {
if (typeof message === 'string' || message instanceof Error) {
constructor(message: Error | ErrorDescription) {
if (message instanceof Error) {
super(message);
} else {
super(message.message || message.errmsg || message.$err || 'n/a');
Expand Down

0 comments on commit 8842ab9

Please sign in to comment.