From ee679c732095be43378ce333680f4e68af6b239d Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Sat, 27 May 2017 19:19:35 +0100 Subject: [PATCH] Fix #1528 --- src/client/websocket/WebSocketConnection.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/websocket/WebSocketConnection.js b/src/client/websocket/WebSocketConnection.js index 93560a45b..af4a20e8d 100644 --- a/src/client/websocket/WebSocketConnection.js +++ b/src/client/websocket/WebSocketConnection.js @@ -359,13 +359,16 @@ class WebSocketConnection extends EventEmitter { * @param {Error} error Error that occurred */ onError(error) { + if (error && error.message === 'uWs client connection error') { + this.reconnect(); + return; + } /** * Emitted whenever the client's WebSocket encounters a connection error. * @event Client#error * @param {Error} error The encountered error */ this.client.emit(Constants.Events.ERROR, error); - if (error.message === 'uWs client connection error') this.reconnect(); } /**