Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Khang Nghi Lam committed Feb 12, 2016
1 parent 7c6888d commit ce3232c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ class FloatClient extends EventEmitter {

this._client.on('logOnResponse', response => {
if (response.eresult !== EResult.OK) {
if (this.debug) { console.log('[login failed]') }
if (this.debug) {
console.log(response.eresult)
console.log('[login failed]')
}
return this.emit('disconnected')
}

Expand Down Expand Up @@ -113,7 +116,12 @@ class FloatClient extends EventEmitter {
if (this.debug) { console.log('[message]', type) }

if (type === 4004) { this._gcLoaded() }
if (type === 9157) { this._decodeFloat(header, buffer) }
if (type === 9157) {
this._decodeFloat(header, buffer)
}
else{
if (this._defer) { return this._defer.resolve(null) }
}
if (callback) { callback(header, buffer) }
}

Expand Down

0 comments on commit ce3232c

Please sign in to comment.