Skip to content

Commit 8494efb

Browse files
committed
Remove errors related to other PurchaseResult cases
1 parent 5d96d90 commit 8494efb

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

Yosemite/Yosemite/Stores/InAppPurchaseStore.swift

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,10 @@ private extension InAppPurchaseStore {
107107
await transaction.finish()
108108
case .userCancelled:
109109
logInfo("User cancelled the purchase flow")
110-
throw Errors.userCancelled
111110
case .pending:
112111
logError("Purchase returned in a pending state, it might succeed in the future")
113-
throw Errors.pending
114112
@unknown default:
115113
logError("Unknown result for purchase: \(purchaseResult)")
116-
throw Errors.unknownResult
117114
}
118115
completion(.success(purchaseResult))
119116
} catch {
@@ -281,18 +278,6 @@ private extension InAppPurchaseStore {
281278

282279
public extension InAppPurchaseStore {
283280
enum Errors: Error, LocalizedError {
284-
/// The user canceled the IAP flow
285-
case userCancelled
286-
287-
/// The purchase is pending some user action.
288-
///
289-
/// These purchases may succeed in the future, and the resulting `Transaction` will be
290-
/// delivered via `Transaction.updates`
291-
case pending
292-
293-
/// The purchase returned a PurchaseResult value that didn't exist when this was developed
294-
case unknownResult
295-
296281
/// The purchase was successful but the transaction was unverified
297282
///
298283
case unverifiedTransaction
@@ -323,18 +308,6 @@ public extension InAppPurchaseStore {
323308

324309
public var errorDescription: String? {
325310
switch self {
326-
case .userCancelled:
327-
return NSLocalizedString(
328-
"Purchase cancelled by user",
329-
comment: "Error message used when the user cancelled an In-app purchase flow")
330-
case .pending:
331-
return NSLocalizedString(
332-
"Purchase pending",
333-
comment: "Error message used when the purchase is pending some user action")
334-
case .unknownResult:
335-
return NSLocalizedString(
336-
"Unexpected purchase result",
337-
comment: "Error message used when a purchase returned something unexpected that we don't know how to handle")
338311
case .unverifiedTransaction:
339312
return NSLocalizedString(
340313
"The purchase transaction couldn't be verified",

0 commit comments

Comments
 (0)