Alexey Pushkarev
12/08/2018, 10:02 PMbdawg.io
12/08/2018, 10:53 PMsealed class
for your various BillingException
types seem like a win. It in general makes your exceptions nicer to consume via try..catch
or is
For example,
using BillingServiceDisconnectedException
that extends sealed class BillingException
inside your suspend fun connectService()
instead of BillingException(BillingClient.BillingResponse.SERVICE_DISCONNECTED)
https://github.com/lion4ik/BillingCoroutines/blob/c6351b72019e80a67c8665d895752ec652699c34/billing/src/main/java/com/github/lion4ik/billing/BillingManager.kt#L54BillingExceptionFactory
in your suspend fun connectService()
BillingException
a sealed class
instead of just an open class
Dico
12/09/2018, 12:26 AMAlexey Pushkarev
12/09/2018, 11:53 AM