调试书源显示更详细的错误信息

pull/354/head
gedoor 4 years ago
parent 632f48e906
commit ea81350ef4
  1. 5
      app/src/main/java/io/legado/app/help/JsExtensions.kt
  2. 19
      app/src/main/java/io/legado/app/model/Debug.kt
  3. 1
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.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()
}
}

@ -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)
}

@ -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()

Loading…
Cancel
Save