FIX: Refused connections are now handled gracefully
This commit is contained in:
parent
d702c455bd
commit
eda98986f2
|
@ -1013,6 +1013,8 @@ Client.prototype.connect = function connect () {
|
||||||
// Communicate the last-encountered error
|
// Communicate the last-encountered error
|
||||||
if (err instanceof ConnectionError) {
|
if (err instanceof ConnectionError) {
|
||||||
self.emit('connectTimeout', err)
|
self.emit('connectTimeout', err)
|
||||||
|
} else if (err.code === 'ECONNREFUSED') {
|
||||||
|
self.emit('connectRefused', err)
|
||||||
} else {
|
} else {
|
||||||
self.emit('error', err)
|
self.emit('error', err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue