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.
Some services throw raw errors, some throw strings, and Soroban mapper includes
technicalErrorthat 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:
code,message,requestId, optional safe details, and hidden technical details.Acceptance criteria:
technicalErroror raw provider payloads.