Skip to content

Standardize API error envelopes and redact technical details consistently #8

Description

@grantfox-oss

Some services throw raw errors, some throw strings, and Soroban mapper includes technicalError that must not reach production clients. Inconsistent envelopes make mobile/frontend handling brittle and can leak operational details.

Affected areas: app/backend/src/common/soroban-errors/*, app/backend/src/sentry/*, app/backend/src/common/utils/redaction.util.ts, app/backend/src/transactions/*, app/backend/src/refunds/*, app/backend/src/contracts/*, OpenAPI docs/tests.

Implementation scope:

  • Add a global API error shape with code, message, requestId, optional safe details, and hidden technical details.
  • Ensure filters redact Soroban raw errors, Supabase errors, secrets, and account-sensitive fields.
  • Convert major backend services to throw typed domain exceptions.
  • Update OpenAPI error schemas.

Acceptance criteria:

  • Production responses never include technicalError or raw provider payloads.
  • Clients can switch on stable error codes across refunds, transactions, registry, and ingestion.
  • Tests cover redaction for Supabase JWT-like strings, Soroban host errors, secrets, and account IDs.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions