diff --git a/lib/url_parser.js b/lib/url_parser.js index dfa1aa0be6..3f931fe8bc 100644 --- a/lib/url_parser.js +++ b/lib/url_parser.js @@ -10,9 +10,8 @@ var ReadPreference = require('./read_preference'), module.exports = function(url, options, callback) { var result = parser.parse(url, true); if (result.protocol !== 'mongodb:') { - // TODO fix this if (result.protocol !== 'mongodb+srv:') { - throw new Error('invalid schema, expected mongodb or mongodb+srv'); + callback(new Error('invalid schema, expected mongodb or mongodb+srv')); } }