Correctly handle error on connection

pull/438/head
Fabrizio Ruggeri 2020-04-17 17:34:54 +02:00
parent b7a36700f9
commit 4c94412439
1 changed files with 3 additions and 2 deletions

View File

@ -858,13 +858,14 @@ export class OpenVidu {
/** /**
* @hidden * @hidden
*/ */
startWs(onConnectSucces: (error: Error) => void): void { startWs(onConnectOrError: (error: Error) => void): void {
const config = { const config = {
heartbeat: 5000, heartbeat: 5000,
sendCloseMessage: false, sendCloseMessage: false,
ws: { ws: {
uri: this.wsUri, uri: this.wsUri,
onconnected: onConnectSucces, onconnected: onConnectOrError,
onerror: onConnectOrError,
ondisconnect: this.disconnectCallback.bind(this), ondisconnect: this.disconnectCallback.bind(this),
onreconnecting: this.reconnectingCallback.bind(this), onreconnecting: this.reconnectingCallback.bind(this),
onreconnected: this.reconnectedCallback.bind(this) onreconnected: this.reconnectedCallback.bind(this)