Commit 9115106a authored by Leonardo Aramaki's avatar Leonardo Aramaki

Handle exceptions on ChatRoomsPresenter#chatRoomsByName() method

parent 081b079c
...@@ -82,6 +82,7 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView, ...@@ -82,6 +82,7 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
fun chatRoomsByName(name: String) { fun chatRoomsByName(name: String) {
val currentServer = serverInteractor.get()!! val currentServer = serverInteractor.get()!!
launchUI(strategy) { launchUI(strategy) {
try {
val roomList = getChatRoomsInteractor.getByName(currentServer, name) val roomList = getChatRoomsInteractor.getByName(currentServer, name)
if (roomList.isEmpty()) { if (roomList.isEmpty()) {
val (users, rooms) = client.spotlight(name) val (users, rooms) = client.spotlight(name)
...@@ -92,6 +93,9 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView, ...@@ -92,6 +93,9 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
} else { } else {
view.updateChatRooms(roomList) view.updateChatRooms(roomList)
} }
} catch (ex: RocketChatException) {
Timber.e(ex)
}
} }
} }
......
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