Rethrow CancellationException

This commit is contained in:
Koitharu
2022-04-14 08:07:57 +03:00
parent 1b3af70690
commit 9c9a389aa5
3 changed files with 5 additions and 3 deletions

View File

@@ -141,8 +141,9 @@ class DownloadManager(
}
val localManga = localMangaRepository.getFromFile(output.file)
outState.value = DownloadState.Done(startId, data, cover, localManga)
} catch (_: CancellationException) {
} catch (e: CancellationException) {
outState.value = DownloadState.Cancelled(startId, manga, cover)
throw e
} catch (e: Throwable) {
if (BuildConfig.DEBUG) {
e.printStackTrace()