From 480bead14ca0f65a9d53359711d90068a9d64eb9 Mon Sep 17 00:00:00 2001 From: Karim Guirguis Date: Mon, 31 Jul 2017 16:17:41 -0400 Subject: [PATCH 1/2] handle event error --- lib/client.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/client.js b/lib/client.js index 3bd800b..dd9275e 100644 --- a/lib/client.js +++ b/lib/client.js @@ -35,6 +35,10 @@ function Client( hostname, username, password, sslVerify) { self.emit('ready'); }); + vc.once('error', function() { + self.emit('error'); + }); + this.vc = vc; return this; From 950cbd1d49a847d3eaaf71d609157b6a10b85dbe Mon Sep 17 00:00:00 2001 From: Karim Guirguis Date: Mon, 14 Aug 2017 10:43:16 -0400 Subject: [PATCH 2/2] include error when emitting event --- lib/client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client.js b/lib/client.js index dd9275e..cd5608c 100644 --- a/lib/client.js +++ b/lib/client.js @@ -35,8 +35,8 @@ function Client( hostname, username, password, sslVerify) { self.emit('ready'); }); - vc.once('error', function() { - self.emit('error'); + vc.once('error', function(err) { + self.emit('error', err); }); this.vc = vc;