@@ -12,7 +12,7 @@ module.exports = function createClient (port_arg, host_arg, options) {
1212 host = host_arg ;
1313 } else {
1414 if ( options && host_arg ) {
15- throw new Error ( 'Unknown type of connection in createClient()' ) ;
15+ throw new TypeError ( 'Unknown type of connection in createClient()' ) ;
1616 }
1717 options = options || host_arg ;
1818 }
@@ -50,14 +50,14 @@ module.exports = function createClient (port_arg, host_arg, options) {
5050 if ( options [ elem ] === parsed . query [ elem ] ) {
5151 console . warn ( 'node_redis: WARNING: You passed the ' + elem + ' option twice!' ) ;
5252 } else {
53- throw new Error ( 'The ' + elem + ' option is added twice and does not match' ) ;
53+ throw new RangeError ( 'The ' + elem + ' option is added twice and does not match' ) ;
5454 }
5555 }
5656 options [ elem ] = parsed . query [ elem ] ;
5757 }
5858 }
5959 } else if ( parsed . hostname ) {
60- throw new Error ( 'The redis url must begin with slashes "//" or contain slashes after the redis protocol' ) ;
60+ throw new RangeError ( 'The redis url must begin with slashes "//" or contain slashes after the redis protocol' ) ;
6161 } else {
6262 options . path = port_arg ;
6363 }
@@ -67,12 +67,12 @@ module.exports = function createClient (port_arg, host_arg, options) {
6767 options . host = options . host || host_arg ;
6868
6969 if ( port_arg && arguments . length !== 1 ) {
70- throw new Error ( 'To many arguments passed to createClient. Please only pass the options object' ) ;
70+ throw new TypeError ( 'To many arguments passed to createClient. Please only pass the options object' ) ;
7171 }
7272 }
7373
7474 if ( ! options ) {
75- throw new Error ( 'Unknown type of connection in createClient()' ) ;
75+ throw new TypeError ( 'Unknown type of connection in createClient()' ) ;
7676 }
7777
7878 return options ;
0 commit comments