From 7329f03bc5e6fa63723d8b19ef8a351916af3631 Mon Sep 17 00:00:00 2001 From: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> Date: Thu, 12 Jan 2023 19:45:38 -0300 Subject: [PATCH] Show proper Exception message in MangaScreen (#8900) Show proper Exception message in MangaScreen. --- .../java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt index 2c08086ce8..412ecb298a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt @@ -224,7 +224,8 @@ class MangaInfoScreenModel( logcat(LogPriority.ERROR, e) coroutineScope.launch { - snackbarHostState.showSnackbar(message = e.toString()) + val errorMessage = e.message.orEmpty().ifEmpty { e.toString() } + snackbarHostState.showSnackbar(message = errorMessage) } } } @@ -542,7 +543,7 @@ class MangaInfoScreenModel( context.getString(R.string.no_chapters_error) } else { logcat(LogPriority.ERROR, e) - e.toString() + e.message.orEmpty().ifEmpty { e.toString() } } coroutineScope.launch {