From 5200e4917597195d5e94992907e96d346d9f521e Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 10 May 2019 10:40:02 -0500 Subject: [PATCH] Capture 401 http status codes as already subscribed error when creating a Feedbin subscription --- Frameworks/Account/Feedbin/FeedbinAPICaller.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Frameworks/Account/Feedbin/FeedbinAPICaller.swift b/Frameworks/Account/Feedbin/FeedbinAPICaller.swift index ef7636140..9bce1b4d9 100644 --- a/Frameworks/Account/Feedbin/FeedbinAPICaller.swift +++ b/Frameworks/Account/Feedbin/FeedbinAPICaller.swift @@ -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: