From d7902bc86e646224bbcf3d56cdb5a92067f75a4d Mon Sep 17 00:00:00 2001 From: darken Date: Wed, 19 Jan 2022 15:31:26 +0100 Subject: [PATCH] Catch billing client exception --- .../core/client/BillingClientConnectionProvider.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/gplay/java/eu/darken/capod/common/upgrade/core/client/BillingClientConnectionProvider.kt b/app/src/gplay/java/eu/darken/capod/common/upgrade/core/client/BillingClientConnectionProvider.kt index 169fba4f..6d67b83c 100644 --- a/app/src/gplay/java/eu/darken/capod/common/upgrade/core/client/BillingClientConnectionProvider.kt +++ b/app/src/gplay/java/eu/darken/capod/common/upgrade/core/client/BillingClientConnectionProvider.kt @@ -14,10 +14,7 @@ import eu.darken.capod.common.flow.setupCommonEventHandlers import kotlinx.coroutines.CancellationException import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.callbackFlow -import kotlinx.coroutines.flow.retryWhen +import kotlinx.coroutines.flow.* import javax.inject.Inject import javax.inject.Singleton import kotlin.coroutines.resume @@ -112,8 +109,11 @@ class BillingClientConnectionProvider @Inject constructor( delay(3000 * attempt) true } + .catch { + log(TAG, ERROR) { "Unable to provide client connection:\n${it.asLog()}" } + } companion object { - val TAG: String = logTag("Upgrade", "Gplay", "Billing", "ClientProvider") + val TAG: String = logTag("Upgrade", "Gplay", "Billing", "Client", "ConnectionProvider") } } \ No newline at end of file