From 6415a4cdd72f8f808e71a9d206a5533d678a2ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E9=99=B6?= Date: Wed, 8 Apr 2015 17:52:15 +0800 Subject: [PATCH] fix: emit the error instead of slient swallow it I got kafka-node:zookeeper Exception: CONNECTION_LOSS[-4] error sometimes, and the error sliently swallowed so it can not be catched --- lib/zookeeper.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/zookeeper.js b/lib/zookeeper.js index af9d5e30..b2fd6679 100644 --- a/lib/zookeeper.js +++ b/lib/zookeeper.js @@ -253,10 +253,12 @@ Zookeeper.prototype.listConsumers = function (groupId) { that.listConsumers(groupId); }, function (error, children) { - if (error) + if (error) { debug(error); - else + that.emit('error', error); + } else { that.emit('consumersChanged'); + } } ); };