|
@@ -169,6 +169,7 @@ fun WebViewUpdateError(error: Throwable?, onRetry: () -> Unit) {
|
|
|
}
|
|
|
|
|
|
private suspend fun UpdateController.check(action: (exception: Throwable) -> Unit = {}): Boolean {
|
|
|
+ var exception: Throwable? = null
|
|
|
return packages.firstOrNull { pkg ->
|
|
|
runCatching {
|
|
|
withContext(Dispatchers.IO) {
|
|
@@ -179,8 +180,8 @@ private suspend fun UpdateController.check(action: (exception: Throwable) -> Uni
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }.onFailure(action).isSuccess
|
|
|
- }?.let { true } ?: false
|
|
|
+ }.onFailure { exception = it }.isSuccess
|
|
|
+ }?.let { true } ?: action(exception ?: NoSuchElementException("更新包为空")).let { false }
|
|
|
}
|
|
|
|
|
|
|