From c1fa784009e7e212ca6896d4a0d0228e11d7a552 Mon Sep 17 00:00:00 2001 From: Syed Idris Shah Date: Thu, 31 Jul 2014 11:19:36 -0700 Subject: [PATCH] Catch error in client. --- lib/simplebus.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/simplebus.js b/lib/simplebus.js index 75a9569..9c38808 100644 --- a/lib/simplebus.js +++ b/lib/simplebus.js @@ -118,6 +118,9 @@ function Client(port, host) { client.on('remote', function (bus) { remotebus = bus; }); + client.on('error', function (err) { + fn(err); + }); client.connect(port, host); }