mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 19:53:25 +01:00
Improves maketplace source error messages
This commit is contained in:
@@ -25,8 +25,8 @@ extension SourceError
|
|||||||
case missingPermissionUsageDescription
|
case missingPermissionUsageDescription
|
||||||
case missingScreenshotSize
|
case missingScreenshotSize
|
||||||
|
|
||||||
case marketplaceAppsNotSupported = 101
|
case marketplaceNotSupported = 101
|
||||||
case marketplaceAppsRequired
|
case marketplaceRequired
|
||||||
}
|
}
|
||||||
|
|
||||||
static func unsupported(_ source: Source) -> SourceError { SourceError(code: .unsupported, source: source) }
|
static func unsupported(_ source: Source) -> SourceError { SourceError(code: .unsupported, source: source) }
|
||||||
@@ -45,12 +45,12 @@ extension SourceError
|
|||||||
SourceError(code: .missingScreenshotSize, source: source, app: screenshot.app, screenshotURL: screenshot.imageURL)
|
SourceError(code: .missingScreenshotSize, source: source, app: screenshot.app, screenshotURL: screenshot.imageURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func marketplaceAppsNotSupported(source: Source) -> SourceError {
|
static func marketplaceNotSupported(source: Source) -> SourceError {
|
||||||
return SourceError(code: .marketplaceAppsNotSupported, source: source)
|
return SourceError(code: .marketplaceNotSupported, source: source)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func marketplaceAppsRequired(source: Source) -> SourceError {
|
static func marketplaceRequired(source: Source) -> SourceError {
|
||||||
return SourceError(code: .marketplaceAppsRequired, source: source)
|
return SourceError(code: .marketplaceRequired, source: source)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,12 +140,12 @@ struct SourceError: ALTLocalizedError
|
|||||||
let failureReason = baseMessage + ": \(screenshotURL.absoluteString)"
|
let failureReason = baseMessage + ": \(screenshotURL.absoluteString)"
|
||||||
return failureReason
|
return failureReason
|
||||||
|
|
||||||
case .marketplaceAppsNotSupported:
|
case .marketplaceNotSupported:
|
||||||
let failureReason = String(format: NSLocalizedString("The source “%@” contains notarized apps, which are not supported by this version of AltStore.", comment: ""), self.$source.name)
|
let failureReason = String(format: NSLocalizedString("The source “%@” contains notarized apps, which are not supported by this version of AltStore.", comment: ""), self.$source.name)
|
||||||
return failureReason
|
return failureReason
|
||||||
|
|
||||||
case .marketplaceAppsRequired:
|
case .marketplaceRequired:
|
||||||
let failureReason = String(format: NSLocalizedString("The source “%@” contains non-marketplace apps, which are not supported by this version of AltStore.", comment: ""), self.$source.name)
|
let failureReason = String(format: NSLocalizedString("One or more apps in source “%@” are missing a marketplaceID. This most likely means they are not notarized, which is not supported by this version of AltStore.", comment: ""), self.$source.name)
|
||||||
return failureReason
|
return failureReason
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,7 +185,7 @@ struct SourceError: ALTLocalizedError
|
|||||||
let recoverySuggestion = NSLocalizedString("Please remove the existing source in order to add this one.", comment: "")
|
let recoverySuggestion = NSLocalizedString("Please remove the existing source in order to add this one.", comment: "")
|
||||||
return recoverySuggestion
|
return recoverySuggestion
|
||||||
|
|
||||||
case .marketplaceAppsRequired:
|
case .marketplaceRequired:
|
||||||
let failureReason = String(format: NSLocalizedString("AltStore can only install marketplace apps that have been notarized by Apple.", comment: ""), self.$source.name)
|
let failureReason = String(format: NSLocalizedString("AltStore can only install marketplace apps that have been notarized by Apple.", comment: ""), self.$source.name)
|
||||||
return failureReason
|
return failureReason
|
||||||
|
|
||||||
|
|||||||
@@ -228,9 +228,9 @@ private extension FetchSourceOperation
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if MARKETPLACE
|
#if MARKETPLACE
|
||||||
guard app.marketplaceID != nil else { throw SourceError.marketplaceAppsRequired(source: source) }
|
guard app.marketplaceID != nil else { throw SourceError.marketplaceRequired(source: source) }
|
||||||
#else
|
#else
|
||||||
guard app.marketplaceID == nil else { throw SourceError.marketplaceAppsNotSupported(source: source) }
|
guard app.marketplaceID == nil else { throw SourceError.marketplaceNotSupported(source: source) }
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user