Replaces StoreApp.setVersions() preconditionFailure with runtime error

It’s more common than expected for apps to not have any app versions, so better to fail gracefully than crash.
This commit is contained in:
Riley Testut
2022-11-23 19:08:31 -06:00
parent ca9c0596f8
commit f0a022c9ec
4 changed files with 93 additions and 12 deletions

View File

@@ -199,8 +199,13 @@ private extension BrowseViewController
throw error
}
}
catch
catch var error as NSError
{
if error.localizedTitle == nil
{
error = error.withLocalizedTitle(NSLocalizedString("Unable to Refresh Store", comment: ""))
}
DispatchQueue.main.async {
if self.dataSource.itemCount > 0
{

View File

@@ -210,8 +210,13 @@ private extension NewsViewController
throw error
}
}
catch
catch var error as NSError
{
if error.localizedTitle == nil
{
error = error.withLocalizedTitle(NSLocalizedString("Unable to Refresh Store", comment: ""))
}
DispatchQueue.main.async {
if self.dataSource.itemCount > 0
{