Add better error messages for add feed shortcut

This commit is contained in:
Maurice Parker
2019-10-18 20:18:25 -05:00
parent e52fb6ea32
commit ba2d05ec27
2 changed files with 33 additions and 2 deletions

View File

@@ -57,8 +57,15 @@ public class AddFeedIntentHandler: NSObject, AddFeedIntentHandling {
switch result {
case .success:
completion(AddFeedIntentResponse(code: .success, userActivity: nil))
case .failure:
completion(AddFeedIntentResponse(code: .failure, userActivity: nil))
case .failure(let error):
switch error {
case AccountError.createErrorNotFound:
completion(AddFeedIntentResponse(code: .feedNotFound, userActivity: nil))
case AccountError.createErrorAlreadySubscribed:
completion(AddFeedIntentResponse(code: .alreadySubscribed, userActivity: nil))
default:
completion(AddFeedIntentResponse(code: .failure, userActivity: nil))
}
}
}
}