mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Catch errors on discover request tab (#765)
## Description Handle errors on the Discover/Jellyseerr requests tab preventing crashes Note: this PR fixes the crash, but the error was a 400, which is likely due to the older Jellyseerr version. ### Related issues Fixes #764
This commit is contained in:
parent
fc0de2144d
commit
47e54aa675
2 changed files with 7 additions and 1 deletions
|
|
@ -40,6 +40,7 @@ import kotlinx.coroutines.Dispatchers
|
|||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.awaitAll
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.catch
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.flow.update
|
||||
|
|
@ -112,6 +113,9 @@ class SeerrRequestsViewModel
|
|||
|
||||
state.update { it.copy(requests = DataLoadingState.Success(results)) }
|
||||
}
|
||||
}.catch { ex ->
|
||||
Timber.e(ex, "Error fetching requests")
|
||||
state.update { it.copy(requests = DataLoadingState.Error(ex)) }
|
||||
}.launchIn(viewModelScope)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue