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,11 +57,18 @@ public class AddFeedIntentHandler: NSObject, AddFeedIntentHandling {
switch result { switch result {
case .success: case .success:
completion(AddFeedIntentResponse(code: .success, userActivity: nil)) completion(AddFeedIntentResponse(code: .success, userActivity: nil))
case .failure: 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)) completion(AddFeedIntentResponse(code: .failure, userActivity: nil))
} }
} }
} }
}
} }

View File

@ -183,6 +183,30 @@
<key>INIntentResponseCodeName</key> <key>INIntentResponseCodeName</key>
<string>failure</string> <string>failure</string>
</dict> </dict>
<dict>
<key>INIntentResponseCodeConciseFormatString</key>
<string>You are already subscribed to this feed in this account.</string>
<key>INIntentResponseCodeConciseFormatStringID</key>
<string>srME8b</string>
<key>INIntentResponseCodeFormatString</key>
<string>You are already subscribed to this feed in this account.</string>
<key>INIntentResponseCodeFormatStringID</key>
<string>UGGPkp</string>
<key>INIntentResponseCodeName</key>
<string>alreadySubscribed</string>
</dict>
<dict>
<key>INIntentResponseCodeConciseFormatString</key>
<string>No feed was found at the specified URL.</string>
<key>INIntentResponseCodeConciseFormatStringID</key>
<string>8Dh9Yy</string>
<key>INIntentResponseCodeFormatString</key>
<string>No feed was found at the specified URL.</string>
<key>INIntentResponseCodeFormatStringID</key>
<string>drQfaI</string>
<key>INIntentResponseCodeName</key>
<string>feedNotFound</string>
</dict>
</array> </array>
</dict> </dict>
<key>INIntentTitle</key> <key>INIntentTitle</key>