Rethrow CancellationException from TrackWorkers #489
This commit is contained in:
@@ -34,6 +34,7 @@ import coil.request.ImageRequest
|
|||||||
import dagger.Reusable
|
import dagger.Reusable
|
||||||
import dagger.assisted.Assisted
|
import dagger.assisted.Assisted
|
||||||
import dagger.assisted.AssistedInject
|
import dagger.assisted.AssistedInject
|
||||||
|
import kotlinx.coroutines.CancellationException
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.NonCancellable
|
import kotlinx.coroutines.NonCancellable
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
@@ -84,6 +85,8 @@ class TrackWorker @AssistedInject constructor(
|
|||||||
logger.log("doWork(): attempt $runAttemptCount")
|
logger.log("doWork(): attempt $runAttemptCount")
|
||||||
return try {
|
return try {
|
||||||
doWorkImpl()
|
doWorkImpl()
|
||||||
|
} catch (e: CancellationException) {
|
||||||
|
throw e
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
logger.log("fatal", e)
|
logger.log("fatal", e)
|
||||||
Result.failure()
|
Result.failure()
|
||||||
|
|||||||
Reference in New Issue
Block a user