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:
@@ -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)")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user