We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cc9a6b commit c9fcecbCopy full SHA for c9fcecb
src/legacy_wrappers/mongo_client.js
@@ -15,8 +15,12 @@ module.exports.makeLegacyMongoClient = function (baseClass) {
15
? options
16
: undefined;
17
options = typeof options !== 'function' ? options : undefined;
18
- const client = new this(url, options);
19
- return maybeCallback(client.connect(callback), callback);
+ try {
+ const client = new this(url, options);
20
+ return maybeCallback(client.connect(callback), callback);
21
+ } catch (error) {
22
+ return maybeCallback(() => Promise.reject(error), callback);
23
+ }
24
}
25
26
connect(callback) {
0 commit comments