Fixes incorrectly handling misc. CancellationErrors

This commit is contained in:
Riley Testut
2023-05-26 15:11:46 -05:00
committed by Magesh K
parent c83d486269
commit 4f6eaf1aac
2 changed files with 15 additions and 0 deletions

View File

@@ -1150,6 +1150,9 @@ private extension MyAppsViewController
catch OperationError.cancelled catch OperationError.cancelled
{ {
// Ignore // Ignore
DispatchQueue.main.async {
installedApp.isActive = false
}
} }
catch catch
{ {
@@ -1222,6 +1225,13 @@ private extension MyAppsViewController
print("Finished deactivating app:", app.bundleIdentifier) print("Finished deactivating app:", app.bundleIdentifier)
} }
catch OperationError.cancelled
{
// Ignore
DispatchQueue.main.async {
installedApp.isActive = true
}
}
catch catch
{ {
print("Failed to deactivate app:", error) print("Failed to deactivate app:", error)

View File

@@ -223,6 +223,11 @@ private extension BackgroundRefreshAppsOperation
{ {
shouldPresentAlert = false shouldPresentAlert = false
} }
catch ~OperationError.Code.serverNotFound
{
shouldPresentAlert = false
}
catch catch
{ {
print("Failed to refresh apps in background.", error) print("Failed to refresh apps in background.", error)