Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit eda9898

Browse files
committed
FIX: Refused connections are now handled gracefully
1 parent d702c45 commit eda9898

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/client/client.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,8 @@ Client.prototype.connect = function connect () {
10131013
// Communicate the last-encountered error
10141014
if (err instanceof ConnectionError) {
10151015
self.emit('connectTimeout', err)
1016+
} else if (err.code === 'ECONNREFUSED') {
1017+
self.emit('connectRefused', err)
10161018
} else {
10171019
self.emit('error', err)
10181020
}

0 commit comments

Comments
 (0)