Rethrow CancellationException
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -143,7 +143,8 @@ class ReaderViewModel(
|
||||
val page = getCurrentPage() ?: error("Page not found")
|
||||
externalStorageHelper.savePage(page, destination)
|
||||
onPageSaved.postCall(destination)
|
||||
} catch (_: CancellationException) {
|
||||
} catch (e: CancellationException) {
|
||||
throw e
|
||||
} catch (e: Exception) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
e.printStackTrace()
|
||||
|
||||
@@ -109,7 +109,7 @@ class PageHolderDelegate(
|
||||
state = State.LOADED
|
||||
callback.onImageReady(file.toUri())
|
||||
} catch (e: CancellationException) {
|
||||
// do nothing
|
||||
throw e
|
||||
} catch (e: Exception) {
|
||||
state = State.ERROR
|
||||
error = e
|
||||
|
||||
Reference in New Issue
Block a user