From 170a011c3cec6f0eae05bfe0cd71ec1d0875f12e Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Wed, 17 Jul 2019 13:15:27 -0400 Subject: [PATCH] fix(connect): don't treat 'connect' as an error event Porting https://github.com/mongodb-js/mongodb-core/pull/446 to the 'next' branch --- lib/core/connection/connect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/connection/connect.js b/lib/core/connection/connect.js index 027ee2997d..e1a643e049 100644 --- a/lib/core/connection/connect.js +++ b/lib/core/connection/connect.js @@ -278,7 +278,7 @@ function makeConnection(family, options, _callback) { socket.setTimeout(connectionTimeout); socket.setNoDelay(noDelay); - const errorEvents = ['error', 'close', 'timeout', 'parseError', 'connect']; + const errorEvents = ['error', 'close', 'timeout', 'parseError']; function errorHandler(eventName) { return err => { errorEvents.forEach(event => socket.removeAllListeners(event));