Use a suitable error for unexpectedly failing to add a feed

This commit is contained in:
Kiel Gillard 2019-10-09 19:15:48 +11:00
parent 92fa66f345
commit 614628883f
1 changed files with 4 additions and 1 deletions

View File

@ -267,13 +267,16 @@ final class FeedlyAccountDelegate: AccountDelegate {
homePageURL: feedlyFeed.website)
folder.addFeed(feed)
}
let feedsAfter = folder.flattenedFeeds()
let added = feedsAfter.subtracting(feedsBefore)
if let feed = added.first {
completion(.success(feed))
} else {
completion(.failure(FeedbinAccountDelegateError.invalidParameter))
completion(.failure(AccountError.createErrorNotFound))
}
case .failure(let error):
completion(.failure(error))
}