Procházet zdrojové kódy

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 před 5 roky
rodič
revize
3c37f0efcc
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4
    0
      modules/xmpp/xmpp.js

+ 4
- 0
modules/xmpp/xmpp.js Zobrazit soubor

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

Načítá se…
Zrušit
Uložit