From 155de2d9e006c4cba233b2cb78547f30fcb336bd Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Fri, 20 Oct 2017 15:54:26 -0400 Subject: [PATCH] fix(url parser): log instead of throw error for unsupported url options --- lib/url_parser.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/url_parser.js b/lib/url_parser.js index 8102299c0e..5a287ae66d 100644 --- a/lib/url_parser.js +++ b/lib/url_parser.js @@ -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 @@ -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; @@ -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; } });