Skip to content

Commit

Permalink
moved error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinDmello committed Dec 23, 2017
1 parent 9a4eb04 commit 033b805
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 033b805

Please sign in to comment.