[polari] serverRoomManager: Handle room list initialization errors



commit ad83474f3a7dc6e35d681b132614c93a3d7a8108
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Mar 23 23:31:12 2017 +0100

    serverRoomManager: Handle room list initialization errors
    
    Currently when an error occurs during room list initialization, the
    list for the account in question won't be available until polari is
    restarted. Instead, handle errors so that we can retry the next time
    the account gets connected.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781072

 src/serverRoomManager.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/serverRoomManager.js b/src/serverRoomManager.js
index fd9b841..9c60f72 100644
--- a/src/serverRoomManager.js
+++ b/src/serverRoomManager.js
@@ -65,7 +65,12 @@ const _ServerRoomManager = new Lang.Class({
 
         let roomList = new Tp.RoomList({ account: account });
         roomList.init_async(GLib.PRIORITY_DEFAULT, null, (o, res) => {
-            roomList.init_finish(res);
+            try {
+                roomList.init_finish(res);
+            } catch(e) {
+                this._roomLists.delete(account);
+                return;
+            }
             roomList.start();
         });
         roomList.connect('got-room', Lang.bind(this, this._onGotRoom));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]