Capture 401 http status codes as already subscribed error when creating a Feedbin subscription

This commit is contained in:
Maurice Parker 2019-05-10 10:40:02 -05:00
parent fd8a973084
commit 5200e49175

View File

@ -172,9 +172,14 @@ final class FeedbinAPICaller: NSObject {
switch error {
case TransportError.httpError(let status):
if status == 404 {
switch status {
case 401:
// I don't know why we get 401's here. This looks like a Feedbin bug, but it only happens
// when you are already subscribed to the feed.
completion(.success(.alreadySubscribed))
case 404:
completion(.success(.notFound))
} else {
default:
completion(.failure(error))
}
default: