refactor(apple): Downgrade noIPCData to warning for logs (#7813)

If the system extension has not been enabled by the user, opening the
`Settings -> Diagnostic Logs` pane will trigger this error. There's
nothing we can do until they enable the system extension, so don't
capture this particular case in Sentry.
This commit is contained in:
Jamil
2025-01-21 21:31:21 -08:00
committed by GitHub
parent ac77fc7ab0
commit d898884ddb

View File

@@ -92,7 +92,13 @@ public final class SettingsViewModel: ObservableObject {
return byteCountFormatter.string(fromByteCount: Int64(totalSize))
} catch {
Log.error(error)
if let error = error as? VPNConfigurationManagerError,
case VPNConfigurationManagerError.noIPCData = error {
// Will happen if the extension is not enabled
Log.warning("\(#function): Unable to count logs: \(error). Is the XPC service running?")
} else {
Log.error(error)
}
return "Unknown"
}
@@ -616,7 +622,12 @@ public struct SettingsView: View {
window.contentViewController?.presentingViewController?.dismiss(self)
}
} catch {
Log.error(error)
if let error = error as? VPNConfigurationManagerError,
case VPNConfigurationManagerError.noIPCData = error {
Log.warning("\(#function): Error exporting logs: \(error). Is the XPC service running?")
} else {
Log.error(error)
}
let alert = await NSAlert()
await MainActor.run {