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,
fun loadChatRooms() {
launchUI(strategy) {
view.showLoading()
view.updateChatRooms(loadRooms())
subscribeRoomUpdates()
view.hideLoading()
try {
view.updateChatRooms(loadRooms())
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