Commit 37795ffb authored by Leonardo Aramaki's avatar Leonardo Aramaki

Add try-catch when loading rooms

parent f2db559a
...@@ -38,9 +38,15 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView, ...@@ -38,9 +38,15 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
fun loadChatRooms() { fun loadChatRooms() {
launchUI(strategy) { launchUI(strategy) {
view.showLoading() view.showLoading()
view.updateChatRooms(loadRooms()) try {
subscribeRoomUpdates() view.updateChatRooms(loadRooms())
view.hideLoading() subscribeRoomUpdates()
} catch (e: RocketChatException) {
Timber.e(e)
view.showMessage(e.message!!)
} finally {
view.hideLoading()
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment