优化
This commit is contained in:
@@ -102,6 +102,7 @@ interface JsExtensions : JsEncodeUtils {
|
||||
return kotlin.runCatching {
|
||||
analyzeUrl.getStrResponse().body
|
||||
}.onFailure {
|
||||
rhinoContext.ensureActive()
|
||||
AppLog.put("ajax(${urlStr}) error\n${it.localizedMessage}", it)
|
||||
}.getOrElse {
|
||||
it.stackTraceStr
|
||||
@@ -136,6 +137,7 @@ interface JsExtensions : JsEncodeUtils {
|
||||
return kotlin.runCatching {
|
||||
analyzeUrl.getStrResponse()
|
||||
}.onFailure {
|
||||
rhinoContext.ensureActive()
|
||||
AppLog.put("connect(${urlStr}) error\n${it.localizedMessage}", it)
|
||||
}.getOrElse {
|
||||
StrResponse(analyzeUrl.url, it.stackTraceStr)
|
||||
@@ -153,6 +155,7 @@ interface JsExtensions : JsEncodeUtils {
|
||||
return kotlin.runCatching {
|
||||
analyzeUrl.getStrResponse()
|
||||
}.onFailure {
|
||||
rhinoContext.ensureActive()
|
||||
AppLog.put("ajax($urlStr,$header) error\n${it.localizedMessage}", it)
|
||||
}.getOrElse {
|
||||
StrResponse(analyzeUrl.url, it.stackTraceStr)
|
||||
|
||||
@@ -25,6 +25,7 @@ import io.legado.app.utils.isJson
|
||||
import io.legado.app.utils.printOnDebug
|
||||
import io.legado.app.utils.splitNotBlank
|
||||
import io.legado.app.utils.stackTraceStr
|
||||
import kotlinx.coroutines.ensureActive
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.withTimeout
|
||||
import org.apache.commons.text.StringEscapeUtils
|
||||
@@ -794,6 +795,7 @@ class AnalyzeRule(
|
||||
return kotlin.runCatching {
|
||||
analyzeUrl.getStrResponse().body
|
||||
}.onFailure {
|
||||
coroutineContext.ensureActive()
|
||||
log("ajax(${urlStr}) error\n${it.stackTraceToString()}")
|
||||
it.printOnDebug()
|
||||
}.getOrElse {
|
||||
|
||||
Reference in New Issue
Block a user