diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/domain/RunNetTest.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/domain/RunNetTest.kt index f6f27216..c79eb421 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/domain/RunNetTest.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/domain/RunNetTest.kt @@ -221,7 +221,7 @@ class RunNetTest( is TaskEvent.StartupFailure, is TaskEvent.ResolverLookupFailure, - -> { + -> { val message = when (event) { is TaskEvent.StartupFailure -> event.message is TaskEvent.ResolverLookupFailure -> event.message @@ -232,22 +232,24 @@ class RunNetTest( updateResult { it.copy( failureMessage = - if (it.failureMessage != null) { - "${it.failureMessage}\n$message" - } else { - message - }, + if (it.failureMessage != null) { + "${it.failureMessage}\n$message" + } else { + message + }, ) } } - val value = when (event) { - is TaskEvent.StartupFailure -> event.value - is TaskEvent.ResolverLookupFailure -> event.value - else -> null - } ?: return + when (event) { + is TaskEvent.StartupFailure -> + Logger.w(message ?: "StartupFailure", Failure(event.value)) + + is TaskEvent.ResolverLookupFailure -> + Logger.i(message ?: "ResolverLookupFailure", Failure(event.value)) - Logger.w(message ?: "Failure", Failure(value)) + else -> Unit + } } is TaskEvent.BugJsonDump -> {