This commit is contained in:
ag2s20150909 committed 2022-04-07 22:05:58 +08:00
1 parent 79f2cf2d29
commit 1ec36795ce
7 files changed
+179 -101

No files matched your search

@@ -54,6 +54,7 @@ object CronetLoader : CronetEngine.Builder.LibraryLoader() {
/**
* 判断Cronet是否安装完成
*/
@Synchronized
fun install(): Boolean {
if (cacheInstall) {
return true
@@ -1,5 +1,7 @@
package io.legado.app.utils
import java.io.IOException
val Throwable.msg: String
get() {
val stackTrace = stackTraceToString()
@@ -8,4 +10,10 @@ val Throwable.msg: String
stackTrace.isNotEmpty() -> stackTrace
else -> lMsg
}
}
}
fun Throwable.rethrowAsIOException(): IOException {
val newException = IOException(this.message)
newException.initCause(this)
throw newException
}