@@ -12,7 +12,7 @@ module.exports = function createClient (port_arg, host_arg, options) {
12
12
host = host_arg ;
13
13
} else {
14
14
if ( options && host_arg ) {
15
- throw new Error ( 'Unknown type of connection in createClient()' ) ;
15
+ throw new TypeError ( 'Unknown type of connection in createClient()' ) ;
16
16
}
17
17
options = options || host_arg ;
18
18
}
@@ -50,14 +50,14 @@ module.exports = function createClient (port_arg, host_arg, options) {
50
50
if ( options [ elem ] === parsed . query [ elem ] ) {
51
51
console . warn ( 'node_redis: WARNING: You passed the ' + elem + ' option twice!' ) ;
52
52
} 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' ) ;
54
54
}
55
55
}
56
56
options [ elem ] = parsed . query [ elem ] ;
57
57
}
58
58
}
59
59
} 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' ) ;
61
61
} else {
62
62
options . path = port_arg ;
63
63
}
@@ -67,12 +67,12 @@ module.exports = function createClient (port_arg, host_arg, options) {
67
67
options . host = options . host || host_arg ;
68
68
69
69
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' ) ;
71
71
}
72
72
}
73
73
74
74
if ( ! options ) {
75
- throw new Error ( 'Unknown type of connection in createClient()' ) ;
75
+ throw new TypeError ( 'Unknown type of connection in createClient()' ) ;
76
76
}
77
77
78
78
return options ;
0 commit comments