From 079df98f3fd57fa57811f42d030f9c03a147c1b4 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 27 Apr 2022 09:43:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/storage/AppWebDav.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/storage/AppWebDav.kt b/app/src/main/java/io/legado/app/help/storage/AppWebDav.kt index e6788fdf7..05ee9be0b 100644 --- a/app/src/main/java/io/legado/app/help/storage/AppWebDav.kt +++ b/app/src/main/java/io/legado/app/help/storage/AppWebDav.kt @@ -2,6 +2,7 @@ package io.legado.app.help.storage import android.content.Context import io.legado.app.R +import io.legado.app.constant.AppLog import io.legado.app.constant.PreferKey import io.legado.app.data.appDb import io.legado.app.data.entities.Book @@ -160,7 +161,9 @@ object AppWebDav { WebDav(putUrl, it).upload(byteArray, "text/plain") } } catch (e: Exception) { - appCtx.toastOnUi("WebDav导出\n${e.localizedMessage}") + val msg = "WebDav导出\n${e.localizedMessage}" + AppLog.put(msg) + appCtx.toastOnUi(msg) } } @@ -173,6 +176,8 @@ object AppWebDav { val json = GSON.toJson(bookProgress) val url = getProgressUrl(book) WebDav(url, authorization).upload(json.toByteArray(), "application/json") + }.onError { + AppLog.put("上传进度失败\n${it.localizedMessage}") } }