From 033b8051fbaf4245abaadacfa5193a0f9e3924e5 Mon Sep 17 00:00:00 2001 From: Gavin Dmello Date: Sat, 23 Dec 2017 20:10:39 +0000 Subject: [PATCH] moved error handler --- lib/client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client.js b/lib/client.js index d6bbaef0..f0f23485 100644 --- a/lib/client.js +++ b/lib/client.js @@ -64,14 +64,14 @@ function Client (broker, conn) { } this._nextBatch = nextBatch + this.on('error', onError) + nextBatch() conn.on('readable', nextBatch) conn.on('error', this.emit.bind(this, 'error')) this.parser.on('error', this.emit.bind(this, 'error')) - this.on('error', onError) - this._eos = eos(this.conn, this.close.bind(this)) function dedupe (packet) {