From ea81350ef44799b65b2b77c1ffb1858f393be858 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 1 Sep 2020 18:56:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E4=B9=A6=E6=BA=90=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=9B=B4=E8=AF=A6=E7=BB=86=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/help/JsExtensions.kt | 5 +++-- .../main/java/io/legado/app/model/Debug.kt | 19 ++++++++----------- .../app/model/analyzeRule/AnalyzeRule.kt | 1 - 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/JsExtensions.kt b/app/src/main/java/io/legado/app/help/JsExtensions.kt index cafa3dea1..dab032a3c 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -6,6 +6,7 @@ import io.legado.app.constant.AppConst.dateFormat import io.legado.app.model.analyzeRule.AnalyzeUrl import io.legado.app.utils.EncoderUtils import io.legado.app.utils.MD5Utils +import org.jetbrains.anko.getStackTraceString import java.net.URLEncoder import java.util.* @@ -23,7 +24,7 @@ interface JsExtensions { val response = call.execute() response.body() } catch (e: Exception) { - e.localizedMessage + e.getStackTraceString() } } @@ -34,7 +35,7 @@ interface JsExtensions { val response = call.execute() response } catch (e: Exception) { - e.localizedMessage + e.getStackTraceString() } } diff --git a/app/src/main/java/io/legado/app/model/Debug.kt b/app/src/main/java/io/legado/app/model/Debug.kt index 77926b138..cbecbed62 100644 --- a/app/src/main/java/io/legado/app/model/Debug.kt +++ b/app/src/main/java/io/legado/app/model/Debug.kt @@ -7,6 +7,7 @@ import io.legado.app.model.rss.Rss import io.legado.app.model.webBook.WebBook import io.legado.app.utils.htmlFormat import io.legado.app.utils.isAbsUrl +import org.jetbrains.anko.getStackTraceString import java.text.SimpleDateFormat import java.util.* @@ -76,7 +77,7 @@ object Debug { } } .onError { - log(debugSource, it.localizedMessage, state = -1) + log(debugSource, it.getStackTraceString(), state = -1) } } @@ -88,7 +89,7 @@ object Debug { log(debugSource, "︽内容页解析完成", state = 1000) } .onError { - log(debugSource, it.localizedMessage, state = -1) + log(debugSource, it.getStackTraceString(), state = -1) } } @@ -148,11 +149,7 @@ object Debug { } } .onError { - log( - debugSource, - it.localizedMessage, - state = -1 - ) + log(debugSource, it.getStackTraceString(), state = -1) } tasks.add(explore) } @@ -171,7 +168,7 @@ object Debug { } } .onError { - log(debugSource, it.localizedMessage, state = -1) + log(debugSource, it.getStackTraceString(), state = -1) } tasks.add(search) } @@ -185,7 +182,7 @@ object Debug { tocDebug(webBook, book) } .onError { - log(debugSource, it.localizedMessage, state = -1) + log(debugSource, it.getStackTraceString(), state = -1) } tasks.add(info) } @@ -204,7 +201,7 @@ object Debug { } } .onError { - log(debugSource, it.localizedMessage, state = -1) + log(debugSource, it.getStackTraceString(), state = -1) } tasks.add(chapterList) } @@ -221,7 +218,7 @@ object Debug { log(debugSource, "︽正文页解析完成", state = 1000) } .onError { - log(debugSource, it.localizedMessage, state = -1) + log(debugSource, it.getStackTraceString(), state = -1) } tasks.add(content) } diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index 271eb5f68..d5fd17ed3 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -589,7 +589,6 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { /** * 执行JS */ - @Throws(Exception::class) private fun evalJS(jsStr: String, result: Any?): Any? { try { val bindings = SimpleBindings()