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

Add ideas for where to potentially log errors #8195

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ internal class UnsupportedStripeCardScanProxy : StripeCardScanProxy {
"Missing stripecardscan dependency, please add it to your apps build.gradle"
)
}
// TODO: add an error here for if the dependency is missing?
}

override fun attachCardScanFragment(
Expand All @@ -104,5 +105,6 @@ internal class UnsupportedStripeCardScanProxy : StripeCardScanProxy {
"Missing stripecardscan dependency, please add it to your apps build.gradle"
)
}
// TODO: add an error here for if the dependency is missing?
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ fun CardDetailsSectionElementUI(
)
if (controller.isCardScanEnabled && controller.isStripeCardScanAvailable()) {
ScanCardButtonUI(enabled = enabled) {
// TODO: handle the data in the result intent being missing?
controller.cardDetailsElement.controller.numberElement.controller.onCardScanResult(
it.getParcelableExtra(CardScanActivity.CARD_SCAN_PARCELABLE_NAME)
?: CardScanSheetResult.Failed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ internal fun ScanCardButtonUI(
val cardScanLauncher =
rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) {
it.data?.let {
// TODO: log an error here if the card scanner fails?
onResult(it)
}
}
Expand All @@ -44,6 +45,7 @@ internal fun ScanCardButtonUI(
indication = null,
enabled = enabled,
onClick = {
// TODO: run catching and log if the activity was missing?
cardScanLauncher.launch(
Intent(
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import javax.inject.Inject
import javax.inject.Singleton
import kotlin.coroutines.CoroutineContext

// TODO: add extra error analytics to this, as well as alerts for these errors
@Singleton
internal class DefaultEventReporter @Inject internal constructor(
private val mode: EventReporter.Mode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class CardScanSheet private constructor(private val stripePublishableKey: String
CARD_SCAN_FRAGMENT_REQUEST_KEY,
lifecycleOwner
) { _, bundle ->
// TODO: add an error here for params missing?
val result: CardScanSheetResult = bundle.getParcelable(
CARD_SCAN_FRAGMENT_BUNDLE_KEY
) ?: CardScanSheetResult.Failed(Throwable("Card scan params not provided"))
Expand Down