Skip to content

MEDIUM: CoinPay payment error handling silently swallows failures #93

Description

@Inkcha

Description

getCoinpayPayment() and createCoinpayPayment() in apps/web/lib/coinpay.ts silently catch all errors and return null/error objects, making payment failures invisible. If the CoinPay API is temporarily unreachable or returns an unexpected response, the error is swallowed without logging.

Location

apps/web/lib/coinpay.ts:L56, L64:

catch { return null; }

Impact

Silent payment failures — users may not receive their paid entitlements and nobody gets alerted. The payment status route depends on polling CoinPay, and if the poll silently fails, the user sees a perpetual "pending" state.

Suggested Fix

Add error logging before returning null:

catch (err) {
  console.error("[coinpay] failed to fetch payment:", (err as Error).message);
  return null;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions