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

[WEB-1757] Handle new backend error codes that may show in the redemption endpoint #1987

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@
BackendPlayStoreGenericError(7231),
BackendUserIneligibleForPromoOffer(7232),
BackendInvalidAppleSubscriptionKey(7234),
BackendCouldNotCreateAlias(7255),
BackendInvalidAppUserId(7256),
BackendInvalidSubscriberAttributes(7263),
BackendInvalidSubscriberAttributesBody(7264),
BackendSubscriberAttributesAreBeingUpdated(7629),
BackendRequestAlreadyInProgress(7638),
BackendProductIDsMalformed(7662),
BackendInvalidWebRedemptionToken(7849),
BackendPurchaseBelongsToOtherUser(7852),
Expand Down Expand Up @@ -84,7 +88,9 @@
BackendErrorCode.BackendInvalidPaymentModeOrIntroPriceNotProvided,
BackendErrorCode.BackendProductIdForGoogleReceiptNotProvided,
-> PurchasesErrorCode.PurchaseInvalidError
BackendErrorCode.BackendEmptyAppUserId -> PurchasesErrorCode.InvalidAppUserIdError
BackendErrorCode.BackendEmptyAppUserId,
BackendErrorCode.BackendInvalidAppUserId,
-> PurchasesErrorCode.InvalidAppUserIdError

Check warning on line 93 in purchases/src/main/kotlin/com/revenuecat/purchases/common/errors.kt

View check run for this annotation

Codecov / codecov/patch

purchases/src/main/kotlin/com/revenuecat/purchases/common/errors.kt#L93

Added line #L93 was not covered by tests
BackendErrorCode.BackendPlayStoreQuotaExceeded -> PurchasesErrorCode.StoreProblemError
BackendErrorCode.BackendPlayStoreInvalidPackageName,
BackendErrorCode.BackendInvalidPlatform,
Expand All @@ -99,6 +105,10 @@
BackendErrorCode.BackendBadRequest,
BackendErrorCode.BackendInternalServerError,
-> PurchasesErrorCode.UnexpectedBackendResponseError
BackendErrorCode.BackendRequestAlreadyInProgress,
BackendErrorCode.BackendSubscriberAttributesAreBeingUpdated,
-> PurchasesErrorCode.OperationAlreadyInProgressError
BackendErrorCode.BackendCouldNotCreateAlias -> PurchasesErrorCode.ConfigurationError

Check warning on line 111 in purchases/src/main/kotlin/com/revenuecat/purchases/common/errors.kt

View check run for this annotation

Codecov / codecov/patch

purchases/src/main/kotlin/com/revenuecat/purchases/common/errors.kt#L110-L111

Added lines #L110 - L111 were not covered by tests
BackendErrorCode.BackendProductIDsMalformed -> PurchasesErrorCode.UnsupportedError
BackendErrorCode.BackendInvalidWebRedemptionToken -> PurchasesErrorCode.PurchaseInvalidError
BackendErrorCode.BackendPurchaseBelongsToOtherUser -> PurchasesErrorCode.ProductAlreadyPurchasedError
Expand Down