Skip to content

Commit

Permalink
websocket should silently error if there are no listeners for error
Browse files Browse the repository at this point in the history
  • Loading branch information
amishshah committed Sep 9, 2016
1 parent e44853e commit dd62389
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/docs.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/client/websocket/WebSocketManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ class WebSocketManager {
* @event Client#error
* @param {Error} error The encountered error
*/
this.client.emit('error', err);
if (this.client.listenerCount('error') > 0) {
this.client.emit('error', err);
}
this.tryReconnect();
}

Expand Down

0 comments on commit dd62389

Please sign in to comment.