Skip to content

fix: log CoinPay payment errors instead of silent failure - #97

Open
Inkcha wants to merge 1 commit into
profullstack:masterfrom
Inkcha:fix/coinpay-error-handling
Open

fix: log CoinPay payment errors instead of silent failure#97
Inkcha wants to merge 1 commit into
profullstack:masterfrom
Inkcha:fix/coinpay-error-handling

Conversation

@Inkcha

@Inkcha Inkcha commented Jul 27, 2026

Copy link
Copy Markdown

Description

Previously, GET /api served an HTML documentation page. API consumers calling undefined endpoints received 28KB of HTML instead of a proper JSON error, breaking client error handling.

Changes

  • Moved API docs from /api to /api-docs (same content, new URL)
  • Created catch-all route at /api/[[...slug]] that returns JSON 404 for any unmatched API route
  • All working API routes are unchanged (they match before the catch-all)

Related

Addresses the MEDIUM issue reported in #90

Testing

  • GET /api -> {"error": "Not found. See /api-docs for API documentation."} (HTTP 404)
  • GET /api/v1/opinions -> still works
  • GET /api-docs -> still shows the docs page

getCoinpayPayment() and createPayment() silently swallowed all
errors and returned null. This made payment failures invisible —
a temporary CoinPay API outage would silently deny users their
paid entitlements with no alert.

Added console.error logging so operational issues are visible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant