浏览代码

ref(xmpp): capture error msg from Strophe ERROR state

If Strophe goes to the ERROR state it will pass the error message there
and then transition to the DISCONNECTED state, but without any error
msg.
tags/v0.0.2
paweldomas 5 年前
父节点
当前提交
3c37f0efcc
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      modules/xmpp/xmpp.js

+ 4
- 0
modules/xmpp/xmpp.js 查看文件

215
 
215
 
216
             logger.info(`My Jabber ID: ${this.connection.jid}`);
216
             logger.info(`My Jabber ID: ${this.connection.jid}`);
217
 
217
 
218
+            this.lastErrorMsg = undefined;
219
+
218
             // Schedule ping ?
220
             // Schedule ping ?
219
             const pingJid = this.connection.domain;
221
             const pingJid = this.connection.domain;
220
 
222
 
277
                     JitsiConnectionEvents.CONNECTION_FAILED,
279
                     JitsiConnectionEvents.CONNECTION_FAILED,
278
                     JitsiConnectionErrors.OTHER_ERROR, msg);
280
                     JitsiConnectionErrors.OTHER_ERROR, msg);
279
             }
281
             }
282
+        } else if (status === Strophe.Status.ERROR) {
283
+            this.lastErrorMsg = msg;
280
         } else if (status === Strophe.Status.DISCONNECTED) {
284
         } else if (status === Strophe.Status.DISCONNECTED) {
281
             // Stop ping interval
285
             // Stop ping interval
282
             this.connection.ping.stopInterval();
286
             this.connection.ping.stopInterval();

正在加载...
取消
保存