websocket should silently error if there are no listeners for error

This commit is contained in:
Amish Shah
2016-09-09 17:05:12 +01:00
parent e44853ee6d
commit dd623891e2
2 changed files with 4 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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();
}