Browse Source

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.
dev1
paweldomas 5 years ago
parent
commit
3c37f0efcc
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      modules/xmpp/xmpp.js

+ 4
- 0
modules/xmpp/xmpp.js View File

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

Loading…
Cancel
Save