From cba4b8b94ac2861d0cb911134c1e03d7b9153cbf Mon Sep 17 00:00:00 2001 From: David Dias Date: Thu, 23 Jun 2016 08:41:54 +0100 Subject: [PATCH] pass the err on the callback too --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index 4e3490c..1f07a62 100644 --- a/src/index.js +++ b/src/index.js @@ -38,6 +38,10 @@ function TCP () { conn.emit('timeout') }) + socket.once('error', (err) => { + callback(err) + }) + socket.on('connect', () => { callback(null, conn) conn.emit('connect')