Skip to content

Add paid-route error taxonomy for analytics and CLI output #83

Description

@emrekayat

Why this matters

When a paid route fails, reviewers and operators need to know whether it was a payment issue, provider issue, validation issue, or internal error. A small taxonomy makes failures easier to trust and debug.

Scope

Add a typed failure code to paid-route responses and persisted analytics records where possible:

  • payment_required;
  • payment_invalid;
  • provider_timeout;
  • provider_failed;
  • invalid_query;
  • internal_error.

Suggested files:

  • apps/api/src/routes/protected.ts
  • apps/api/src/lib/persistence.ts
  • apps/agent-client/src/client.ts
  • packages/shared/src/schemas.ts

Acceptance criteria

  • Paid-route failures return a stable errorCode without leaking secrets.
  • Analytics can store the code for failed paid attempts when available.
  • CLI prints the code in a compact, human-readable line.
  • Tests cover at least validation failure and provider failure paths.
  • Existing API and agent-client tests pass.

Wave complexity

High - adds operational credibility for paid-query failure handling.

Metadata

Metadata

Labels

Stellar WaveIssue proposed for the Drips Stellar Wave programarea: apiAPI servicearea: dataPersistence and analyticsarea: x402x402 and Stellar paymentscomplexity: highExpected high implementation complexitydrips-candidateCandidate for a Drips Stellar WaveenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions