Checkout failed
Debug React Native checkout and payment failures that never throw a crash — structured logs, breadcrumbs, alerts
The user taps Pay. The card is declined. Your UI shows an error — but nothing lands in crash groups, so support only hears about it days later.
What to instrument
trackScreen("Checkout")when the screen mounts- Info log when checkout starts
- Error log (or
TraceRN.error) when payment fails — withorderIdandreason - Keep auto breadcrumbs on so fetch / Pay tap appear in the trail
javascript
TraceRN.trackScreen("Checkout");
TraceRN.log("checkout.started", { cartSize: items.length, totalCents });
try {
await pay(orderId);
TraceRN.log("order.confirmed", { orderId });
} catch (err) {
TraceRN.error(err instanceof Error ? err : new Error("payment.failed"), {
event: "payment.failed",
orderId,
reason: "card_declined",
});
showToast("Payment failed");
}What you see in TraceRN
- Search
payment.failed(or theorderId) in the log viewer - Open breadcrumbs for screens + network before the failure
- Optional: alert when volume spikes
Related
Last updated · TraceRN docs