Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ErrorUtils.purchasesError(withSKError:): handle URLErrors #3346

Merged
merged 1 commit into from
Oct 26, 2023

Commits on Oct 25, 2023

  1. ErrorUtils.purchasesError(withSKError:): handle URLErrors

    Fixes #3343.
    
    `SKPaymentTransaction.error` docs say:
    > The error property is undefined except when `transactionState` is set to `SKPaymentTransactionState.failed`. Your application can read the error property to determine why the transaction failed. For a list of error constants, see `SKErrorDomain` in StoreKit Constants.
    
    Which is why [`PurchasesOrchestrator` only considered that domain](https://github.com/RevenueCat/purchases-ios/blob/4.28.1/Sources/Purchasing/Purchases/PurchasesOrchestrator.swift#L792).
    
    This expands this handling to consider any other network error, therefore providing more precise errors.
    
    Since offline connection error detection was only in `HTTPClient`, I also moved that out and removed `NetworkError.offlineConnection`, so that we detect this when converting `NetworkError.networkError` instead.
    NachoSoto committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    028f8c6 View commit details
    Browse the repository at this point in the history