Errors are now saved in the logs
This commit is contained in:
parent
4889a8072d
commit
5b5aa136d0
@ -3,6 +3,7 @@ package com.jetpackduba.gitnuro.git
|
|||||||
import com.jetpackduba.gitnuro.managers.ErrorsManager
|
import com.jetpackduba.gitnuro.managers.ErrorsManager
|
||||||
import com.jetpackduba.gitnuro.di.TabScope
|
import com.jetpackduba.gitnuro.di.TabScope
|
||||||
import com.jetpackduba.gitnuro.extensions.delayedStateChange
|
import com.jetpackduba.gitnuro.extensions.delayedStateChange
|
||||||
|
import com.jetpackduba.gitnuro.logging.printError
|
||||||
import com.jetpackduba.gitnuro.managers.newErrorNow
|
import com.jetpackduba.gitnuro.managers.newErrorNow
|
||||||
import com.jetpackduba.gitnuro.ui.SelectedItem
|
import com.jetpackduba.gitnuro.ui.SelectedItem
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
@ -138,6 +139,8 @@ class TabState @Inject constructor(
|
|||||||
|
|
||||||
if (showError && !containsCancellation)
|
if (showError && !containsCancellation)
|
||||||
errorsManager.addError(newErrorNow(ex, ex.message.orEmpty()))
|
errorsManager.addError(newErrorNow(ex, ex.message.orEmpty()))
|
||||||
|
|
||||||
|
printError(TAG, ex.message.orEmpty(), ex)
|
||||||
} finally {
|
} finally {
|
||||||
_processing.value = ProcessingState.None
|
_processing.value = ProcessingState.None
|
||||||
operationRunning = false
|
operationRunning = false
|
||||||
@ -184,6 +187,8 @@ class TabState @Inject constructor(
|
|||||||
|
|
||||||
if (showError && !containsCancellation)
|
if (showError && !containsCancellation)
|
||||||
errorsManager.addError(newErrorNow(ex, ex.localizedMessage))
|
errorsManager.addError(newErrorNow(ex, ex.localizedMessage))
|
||||||
|
|
||||||
|
printError(TAG, ex.message.orEmpty(), ex)
|
||||||
} finally {
|
} finally {
|
||||||
_processing.value = ProcessingState.None
|
_processing.value = ProcessingState.None
|
||||||
operationRunning = false
|
operationRunning = false
|
||||||
@ -213,6 +218,8 @@ class TabState @Inject constructor(
|
|||||||
|
|
||||||
if (showError)
|
if (showError)
|
||||||
errorsManager.addError(newErrorNow(ex, ex.localizedMessage))
|
errorsManager.addError(newErrorNow(ex, ex.localizedMessage))
|
||||||
|
|
||||||
|
printError(TAG, ex.message.orEmpty(), ex)
|
||||||
} finally {
|
} finally {
|
||||||
if (refreshType != RefreshType.NONE && (!hasProcessFailed || refreshEvenIfCrashes))
|
if (refreshType != RefreshType.NONE && (!hasProcessFailed || refreshEvenIfCrashes))
|
||||||
_refreshData.emit(refreshType)
|
_refreshData.emit(refreshType)
|
||||||
|
Loading…
Reference in New Issue
Block a user