Skip to content

Commit b4c437a

Browse files
authored
Merge pull request #15420 from Automattic/vkarpov15/gh-15416
feat(error): set `cause` to MongoDB error `reason` on ServerSelection errors
2 parents 7609cb6 + 6049bd6 commit b4c437a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/error/serverSelection.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class MongooseServerSelectionError extends MongooseError {
4949
this[key] = err[key];
5050
}
5151
}
52+
this.cause = reason;
5253

5354
return this;
5455
}

0 commit comments

Comments
 (0)