Skip to content

Commit

Permalink
fix(url parser): log instead of throw error for unsupported url options
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessica Lord authored and mbroadst committed Oct 24, 2017
1 parent 6a9e7ba commit 155de2d
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions lib/url_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
var ReadPreference = require('./read_preference'),
parser = require('url'),
f = require('util').format,
assign = require('./utils').assign;
assign = require('./utils').assign,
Logger = require('mongodb-core').Logger;

module.exports = function(url, options) {
// Variables
Expand Down Expand Up @@ -265,16 +266,6 @@ module.exports = function(url, options) {
case 'auto_reconnect':
serverOptions.auto_reconnect = value === 'true';
break;
case 'minPoolSize':
throw new Error('minPoolSize not supported');
case 'maxIdleTimeMS':
throw new Error('maxIdleTimeMS not supported');
case 'waitQueueMultiple':
throw new Error('waitQueueMultiple not supported');
case 'waitQueueTimeoutMS':
throw new Error('waitQueueTimeoutMS not supported');
case 'uuidRepresentation':
throw new Error('uuidRepresentation not supported');
case 'ssl':
if (value === 'prefer') {
serverOptions.ssl = value;
Expand Down Expand Up @@ -448,6 +439,8 @@ module.exports = function(url, options) {
serverOptions.compression = compression;
break;
default:
var logger = Logger('URL Parser');
logger.info(`${name} is not supported`);
break;
}
});
Expand Down

0 comments on commit 155de2d

Please sign in to comment.