Rethrow CancellationException from TrackWorkers #489

pull/487/head v6.1
Koitharu 3 years ago
parent a93bc0ed5b
commit 81de6124f0
Signed by: Koitharu
GPG Key ID: 676DEE768C17A9D7

@ -34,6 +34,7 @@ import coil.request.ImageRequest
import dagger.Reusable
import dagger.assisted.Assisted
import dagger.assisted.AssistedInject
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.flow.Flow
@ -84,6 +85,8 @@ class TrackWorker @AssistedInject constructor(
logger.log("doWork(): attempt $runAttemptCount")
return try {
doWorkImpl()
} catch (e: CancellationException) {
throw e
} catch (e: Throwable) {
logger.log("fatal", e)
Result.failure()

Loading…
Cancel
Save