2023-02-13 21:10:07 +01:00
|
|
|
//
|
|
|
|
// https://mczachurski.dev
|
|
|
|
// Copyright © 2023 Marcin Czachurski and the repository contributors.
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
public enum PurchaseError: Error {
|
|
|
|
case failedVerification
|
|
|
|
case system(Error)
|
|
|
|
}
|
|
|
|
|
|
|
|
extension PurchaseError: LocalizedError {
|
|
|
|
public var errorDescription: String? {
|
|
|
|
switch self {
|
|
|
|
case .failedVerification:
|
2023-03-15 14:27:59 +01:00
|
|
|
return NSLocalizedString("global.error.errorDuringPurchaseVerification", comment: "Something went wrong during purchase verification.")
|
2023-02-13 21:10:07 +01:00
|
|
|
case .system(let error):
|
|
|
|
return error.localizedDescription
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|