improvement: enhance Sparkle error logging with error codes

Add error domain and code to abort error messages to help diagnose installation failures.
This commit is contained in:
Micha
2025-12-30 13:27:35 +01:00
parent b96b018f70
commit 215c24d5a2

View File

@@ -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)")
}
}
}
}