mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-16 11:16:12 -04:00
Refactor GPlay billing error handling and translations
This commit introduces localized error messages for Google Play billing issues and refactors the error handling in `UpgradeRepoGplay`. - `BillingException` and `BillingResultException` now implement `HasLocalizedError` to provide user-friendly error messages. - New string translations for billing error labels and descriptions have been added for various languages. - `UpgradeRepoGplay` now includes an `error` field in its `Info` state to propagate billing errors. - The `upgradeInfo` flow in `UpgradeRepoGplay` has been updated with a `retryWhen` operator to handle errors more gracefully. If an error occurs but the pro state was recent, it emits a grace period state. Otherwise, it emits the error. - `OverviewFragmentVM` now observes `upgradeState` and posts any non-pro errors to `errorEvents` for display.
This commit is contained in:
@@ -64,6 +64,7 @@ class UpgradeControlFoss @Inject constructor(
|
||||
override val isPro: Boolean = false,
|
||||
override val upgradedAt: Instant? = null,
|
||||
val upgradeReason: FossUpgrade.Reason? = null,
|
||||
override val error: Throwable? = null,
|
||||
) : UpgradeRepo.Info {
|
||||
override val type: UpgradeRepo.Type = UpgradeRepo.Type.FOSS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user