mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-05-07 11:01:06 +03:00
Catch all exceptions in GenericListModel
This is how it used to be, before i changed it because detekt was complaining.
This commit is contained in:
parent
619f441790
commit
24ae0d9e81
@ -10,8 +10,6 @@ import androidx.lifecycle.LiveData
|
|||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
import java.net.ConnectException
|
|
||||||
import java.net.UnknownHostException
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
@ -89,10 +87,8 @@ open class GenericListModel(application: Application) :
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
load(isOffline, useId3Tags, musicService, refresh, bundle)
|
load(isOffline, useId3Tags, musicService, refresh, bundle)
|
||||||
} catch (exception: ConnectException) {
|
} catch (all: Exception) {
|
||||||
handleException(exception, swipe.context)
|
handleException(all, swipe.context)
|
||||||
} catch (exception: UnknownHostException) {
|
|
||||||
handleException(exception, swipe.context)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user