Skip to content

Commit cd10084

Browse files
author
Jessica Lord
committed
fix(mongo client): do not connect if url parse error
1 parent 4427d7b commit cd10084

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/mongo_client.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,8 @@ var connect = function(self, url, options, callback) {
849849
}
850850

851851
parse(url, options, function(err, object) {
852-
if (err) return console.log(err);
852+
// Do not attempt to connect if parsing error
853+
if (err) return callback(err);
853854

854855
// Parse the string
855856
var _finalOptions = createUnifiedOptions({}, object);

0 commit comments

Comments
 (0)