Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress LookupHost failed error reports #338

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class CrashMonitoring(
) {
if (!Sentry.isEnabled()) return

if (severity == Severity.Warn || severity == Severity.Error) {
if (
(severity == Severity.Warn || severity == Severity.Error) &&
MESSAGES_TO_SKIP_REPORT.none { message.contains(it) }
) {
if (throwable != null) {
addBreadcrumb(severity, message, tag)
Sentry.captureException(throwable)
Expand Down Expand Up @@ -83,4 +86,11 @@ class CrashMonitoring(
)
}
}

companion object {
private val MESSAGES_TO_SKIP_REPORT = listOf(
"Picking from default OpenVPN endpoints",
"sessionresolver: LookupHost failed",
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,9 @@ class RunNetTest(

is TaskEvent.Log -> {
Logger.log(
severity = when {
event.level == "WARNING" && !LOGS_TO_LOWER_LEVEL.contains(event.message) ->
Severity.Warn

event.level == "DEBUG" -> Severity.Debug
severity = when (event.level) {
"WARNING" -> Severity.Warn
"DEBUG" -> Severity.Debug
else -> Severity.Info
},
message = event.message,
Expand Down Expand Up @@ -317,10 +315,4 @@ class RunNetTest(
Failure(message, value)

inner class BugJsonDump(value: TaskEventResult.Value?) : Failure(null, value)

companion object {
private val LOGS_TO_LOWER_LEVEL = listOf(
"Picking from default OpenVPN endpoints",
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class SetupDependencies(
}
}

private fun presentViewController(uiViewController: UIViewController): Boolean {
private fun presentViewController(uiViewController: UIViewController): Boolean {
return findCurrentViewController()?.let { viewController ->

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
Expand Down