Single source for Unknown app ID message.

Resolve #533

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
Ross Goldberg 2024-10-29 04:56:37 -04:00
parent 31dfe81174
commit 1b43c89bec
No known key found for this signature in database
3 changed files with 8 additions and 2 deletions

View file

@ -63,7 +63,7 @@ extension MAS {
// argument is an AppID, lookup apps by id using argument
let installedApps = appLibrary.installedApps(withAppID: appID)
if installedApps.isEmpty {
printError("Unknown app ID \(appID)")
printError(appID.unknownMessage)
}
return installedApps
}

View file

@ -87,7 +87,7 @@ extension MASError: CustomStringConvertible {
case .noSearchResultsFound:
return "No apps found"
case .unknownAppID(let appID):
return "Unknown app ID \(appID)"
return appID.unknownMessage
case .noVendorWebsite:
return "App does not have a vendor website"
case .notInstalled(let appID):

View file

@ -10,6 +10,12 @@ import Foundation
typealias AppID = UInt64
extension AppID {
var unknownMessage: String {
"Unknown app ID \(self)"
}
}
extension NSNumber {
var appIDValue: AppID {
uint64Value