From 4c944124390afde0ef29724f50f036a2d46a306d Mon Sep 17 00:00:00 2001 From: Fabrizio Ruggeri Date: Fri, 17 Apr 2020 17:34:54 +0200 Subject: [PATCH] Correctly handle error on connection --- openvidu-browser/src/OpenVidu/OpenVidu.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openvidu-browser/src/OpenVidu/OpenVidu.ts b/openvidu-browser/src/OpenVidu/OpenVidu.ts index 4f3ea46a..ae1dd352 100644 --- a/openvidu-browser/src/OpenVidu/OpenVidu.ts +++ b/openvidu-browser/src/OpenVidu/OpenVidu.ts @@ -858,13 +858,14 @@ export class OpenVidu { /** * @hidden */ - startWs(onConnectSucces: (error: Error) => void): void { + startWs(onConnectOrError: (error: Error) => void): void { const config = { heartbeat: 5000, sendCloseMessage: false, ws: { uri: this.wsUri, - onconnected: onConnectSucces, + onconnected: onConnectOrError, + onerror: onConnectOrError, ondisconnect: this.disconnectCallback.bind(this), onreconnecting: this.reconnectingCallback.bind(this), onreconnected: this.reconnectedCallback.bind(this)