Skip to content

Commit 4048877

Browse files
authored
Merge pull request #551 from ooni/ignore-cannot-submit-network
Ignore CannotSubmitMeasurement due to network issues
2 parents b11bacb + 8471be3 commit 4048877

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

composeApp/src/commonFullMain/kotlin/org/ooni/probe/shared/monitoring/CrashMonitoring.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class CrashMonitoring(
4545

4646
if (
4747
(severity == Severity.Warn || severity == Severity.Error) &&
48-
MESSAGES_TO_SKIP_REPORT.none { message.contains(it) }
48+
(throwable != null || MESSAGES_TO_SKIP_REPORT.none { message.contains(it) })
4949
) {
5050
if (throwable != null) {
5151
if (message.isNotBlank()) {
@@ -93,6 +93,7 @@ class CrashMonitoring(
9393
private val MESSAGES_TO_SKIP_REPORT = listOf(
9494
"Picking from default OpenVPN endpoints",
9595
"sessionresolver: LookupHost failed",
96+
"cannot submit measurement:",
9697
)
9798
}
9899
}

composeApp/src/commonMain/kotlin/org/ooni/probe/domain/RunNetTest.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package org.ooni.probe.domain
33
import co.touchlab.kermit.Logger
44
import co.touchlab.kermit.Severity
55
import kotlinx.coroutines.flow.Flow
6-
import kotlinx.serialization.encodeToString
76
import kotlinx.serialization.json.Json
87
import org.ooni.engine.models.TaskEvent
98
import org.ooni.engine.models.TaskEventResult
@@ -320,7 +319,13 @@ class RunNetTest(
320319
* Here we group them under a single exception class for crash reporting.
321320
*/
322321
private fun TaskEvent.Log.getKnownException() =
323-
if (message.startsWith("cannot submit measurement")) {
322+
if (
323+
message.startsWith("cannot submit measurement") &&
324+
listOf(
325+
"interrupted", "generic_timeout_error", "connection_aborted", "connection_reset",
326+
"eof_error",
327+
).none { message.contains(it) }
328+
) {
324329
CannotSubmitMeasurement()
325330
} else if (message.startsWith("statsManager") && message.contains("not found:")) {
326331
StatsManagerNotFoundError()

0 commit comments

Comments
 (0)