From 6326a28a1c35af709a70c195ad0cca99be34e373 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 1 Jan 2020 18:08:02 +0800 Subject: [PATCH] up --- .../legado/app/ui/book/source/manage/BookSourceViewModel.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt index 67b22be3f..6ae3bd977 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt @@ -149,9 +149,11 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application) importSource(file.readText(), finally) } else { withContext(Dispatchers.Main) { - finally("文件无法打开") + finally("打开文件出错") } } + }.onError { + finally(it.localizedMessage ?: "打开文件出错") } }