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:
tzugen 2021-06-09 20:24:22 +02:00
parent 619f441790
commit 24ae0d9e81
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
1 changed files with 2 additions and 6 deletions

View File

@ -10,8 +10,6 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import java.net.ConnectException
import java.net.UnknownHostException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
@ -89,10 +87,8 @@ open class GenericListModel(application: Application) :
try {
load(isOffline, useId3Tags, musicService, refresh, bundle)
} catch (exception: ConnectException) {
handleException(exception, swipe.context)
} catch (exception: UnknownHostException) {
handleException(exception, swipe.context)
} catch (all: Exception) {
handleException(all, swipe.context)
}
}