From ba2d05ec27fcbc4de87c0250548b2a8647c426c6 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 18 Oct 2019 20:18:25 -0500 Subject: [PATCH] Add better error messages for add feed shortcut --- iOS/Intents/AddFeedIntentHandler.swift | 11 +++++++++-- iOS/Intents/Intents.intentdefinition | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/iOS/Intents/AddFeedIntentHandler.swift b/iOS/Intents/AddFeedIntentHandler.swift index d648b6eb1..36bacf429 100644 --- a/iOS/Intents/AddFeedIntentHandler.swift +++ b/iOS/Intents/AddFeedIntentHandler.swift @@ -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)) + } } } } diff --git a/iOS/Intents/Intents.intentdefinition b/iOS/Intents/Intents.intentdefinition index 7a1bc85af..a3ce6dc74 100644 --- a/iOS/Intents/Intents.intentdefinition +++ b/iOS/Intents/Intents.intentdefinition @@ -183,6 +183,30 @@ INIntentResponseCodeName failure + + INIntentResponseCodeConciseFormatString + You are already subscribed to this feed in this account. + INIntentResponseCodeConciseFormatStringID + srME8b + INIntentResponseCodeFormatString + You are already subscribed to this feed in this account. + INIntentResponseCodeFormatStringID + UGGPkp + INIntentResponseCodeName + alreadySubscribed + + + INIntentResponseCodeConciseFormatString + No feed was found at the specified URL. + INIntentResponseCodeConciseFormatStringID + 8Dh9Yy + INIntentResponseCodeFormatString + No feed was found at the specified URL. + INIntentResponseCodeFormatStringID + drQfaI + INIntentResponseCodeName + feedNotFound + INIntentTitle