How do I catch a checkout that fails without an error on screen?

Call Sentry.captureException for a thrown failure the page hides. For a decline the page treats as ordinary, call Sentry.logger.warn with a reason code and no card number or email. A log line does not send email. If that decline should open an issue, pass a new Error to Sentry.captureException. Record revenue with postdeploy.track only on the confirmation page.

Last updated 26 November 2026. By Paul Badarau.

Maren, a fictional developer, sells records from her shop. A card decline changes the button to Try again and throws nothing. A network failure is caught, and the page stays on the same step.

  1. In the catch, call Sentry.captureException with the error. That stores an issue. Owners and Administrators are emailed the first time that fingerprint appears.
  2. For a decline the shop treats as ordinary, call Sentry.logger.warn('checkout declined', { reason: 'issuer' }). Sentry.logger.warn sends a log line when the SDK is running. Put the words you will search for in the message. Search matches the message, not the attributes. Leave out the card number, the email address, and the name. Monitoring drops attributes whose names start with user. or client., and it redacts some secrets in the text. That redaction is not a guarantee. A log line does not open an issue and does not send email. When the decline should be an issue, call Sentry.captureException(new Error('checkout declined')).
  3. On the confirmation page only, after the server has recorded the order, call postdeploy.track('order-paid', { revenue: 48 }). The goal must already exist. The number runs from 0 to 1,000,000 and is stored rounded to two decimals. There is no currency code.

A card field in another host's frame often surfaces as Script error., and the installed @sentry/browser drops that text. Errors and log lines are kept 7 days. A decline you only logged is gone after that, and it never emailed you.

The product page for this is Monitoring.

Start your 14-day free trial