Remove unnecessary try catch

parent 5fab419e
...@@ -23,7 +23,6 @@ import com.shopify.livedataktx.nonNull ...@@ -23,7 +23,6 @@ import com.shopify.livedataktx.nonNull
import kotlinx.coroutines.experimental.* import kotlinx.coroutines.experimental.*
import kotlinx.coroutines.experimental.android.UI import kotlinx.coroutines.experimental.android.UI
import timber.log.Timber import timber.log.Timber
import java.lang.IllegalArgumentException
class ChatRoomsViewModel( class ChatRoomsViewModel(
private val connectionManager: ConnectionManager, private val connectionManager: ConnectionManager,
...@@ -43,7 +42,6 @@ class ChatRoomsViewModel( ...@@ -43,7 +42,6 @@ class ChatRoomsViewModel(
return@switchMap if (query.isSearch()) { return@switchMap if (query.isSearch()) {
this@ChatRoomsViewModel.query.wrap(runContext) { _, data: MutableLiveData<RoomsModel> -> this@ChatRoomsViewModel.query.wrap(runContext) { _, data: MutableLiveData<RoomsModel> ->
try {
val string = (query as Query.Search).query val string = (query as Query.Search).query
// debounce, to not query while the user is writing // debounce, to not query while the user is writing
...@@ -58,9 +56,6 @@ class ChatRoomsViewModel( ...@@ -58,9 +56,6 @@ class ChatRoomsViewModel(
}.ifNull { }.ifNull {
data.postValue(rooms) data.postValue(rooms)
} }
} catch (ignore: CancellationException) {
}
} }
} else { } else {
repository.getChatRooms(query.asSortingOrder()) repository.getChatRooms(query.asSortingOrder())
......
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