Bläddra i källkod

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 år sedan
förälder
incheckning
3c37f0efcc
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4
    0
      modules/xmpp/xmpp.js

+ 4
- 0
modules/xmpp/xmpp.js Visa fil

@@ -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();

Laddar…
Avbryt
Spara