From 215c24d5a233fac5d564bc1707b8d9335fb05e5d Mon Sep 17 00:00:00 2001 From: Micha Date: Tue, 30 Dec 2025 13:27:35 +0100 Subject: [PATCH] improvement: enhance Sparkle error logging with error codes Add error domain and code to abort error messages to help diagnose installation failures. --- Sources/ViewModels/SparkleUpdater.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/ViewModels/SparkleUpdater.swift b/Sources/ViewModels/SparkleUpdater.swift index fa49a17..42e05c6 100644 --- a/Sources/ViewModels/SparkleUpdater.swift +++ b/Sources/ViewModels/SparkleUpdater.swift @@ -117,7 +117,12 @@ extension SparkleUpdater: SPUUpdaterDelegate { nonisolated func updater(_ updater: SPUUpdater, didAbortWithError error: Error) { Task { @MainActor in - logError("Sparkle aborted: \(error.localizedDescription)") + let errorDescription = error as NSError + let details = "Domain: \(errorDescription.domain), Code: \(errorDescription.code), Description: \(error.localizedDescription)" + logError("Sparkle aborted: \(details)") + if let underlying = errorDescription.userInfo[NSUnderlyingErrorKey] as? NSError { + logError("Underlying error: Domain: \(underlying.domain), Code: \(underlying.code), Description: \(underlying.localizedDescription)") + } } } }