Explorar o código

Minor exception message cleanup

arkon hai 1 ano
pai
achega
8b65fd5751

+ 2 - 3
app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupCreator.kt

@@ -73,10 +73,9 @@ class BackupCreator(
                     UniFile.fromUri(context, uri)
                 }
                 )
-                ?: throw Exception(context.stringResource(MR.strings.create_backup_file_error))
 
-            if (!file.isFile) {
-                throw IllegalStateException("Failed to get handle on a backup file")
+            if (file == null || !file.isFile) {
+                throw IllegalStateException(context.stringResource(MR.strings.create_backup_file_error))
             }
 
             val databaseManga = getFavorites.await()

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt

@@ -304,7 +304,7 @@ internal object ExtensionLoader {
                     when (val obj = Class.forName(it, false, classLoader).getDeclaredConstructor().newInstance()) {
                         is Source -> listOf(obj)
                         is SourceFactory -> obj.createSources()
-                        else -> throw Exception("Unknown source class type! ${obj.javaClass}")
+                        else -> throw Exception("Unknown source class type: ${obj.javaClass}")
                     }
                 } catch (e: Throwable) {
                     logcat(LogPriority.ERROR, e) { "Extension load error: $extName ($it)" }

+ 1 - 1
source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/online/HttpSource.kt

@@ -473,4 +473,4 @@ abstract class HttpSource : CatalogueSource {
     override fun getFilterList() = FilterList()
 }
 
-class LicensedMangaChaptersException : Exception("Licensed - No chapters to show")
+class LicensedMangaChaptersException : RuntimeException()