Skip to content

Commit

Permalink
Removed the error emits
Browse files Browse the repository at this point in the history
  • Loading branch information
mekwall committed Aug 16, 2014
1 parent 4d538c9 commit 35a9e0f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ Client.prototype.onMessage = function (e) {
var request = new Request(this, payload);
if (typeof this._methods[payload.method] === 'undefined') {
debug('← (%s) Missing handler', payload.method);
this.emit('error', { code: -1, message: 'Missing handler' });
} else if (payload.error) {
debug('← (%s) Error %s: %o', payload.method, payload.error.code, payload.error.message);
this.emit('error', payload.error);
this._methods[payload.method].apply(
request,
[payload.error, payload.params]
Expand All @@ -112,10 +110,8 @@ Client.prototype.onMessage = function (e) {
this,
[payload.error]
);
this.emit('error', payload.error);
} else if (payload.error) {
debug('← Error %s: %o', payload.error.code, payload.error.message);
this.emit('error', payload.error);
} else if (payload.id && this._awaitingResults[payload.id]) {
debug('← (%s) %o', payload.id, payload.result);
this._awaitingResults[payload.id].apply(
Expand Down

0 comments on commit 35a9e0f

Please sign in to comment.