Skip to content

fix: document contract error codes and map backend messages#213

Merged
dev-fatima-24 merged 1 commit into
dev-fatima-24:mainfrom
MickeeJay:fix/contract-error-codes
Apr 29, 2026
Merged

fix: document contract error codes and map backend messages#213
dev-fatima-24 merged 1 commit into
dev-fatima-24:mainfrom
MickeeJay:fix/contract-error-codes

Conversation

@MickeeJay
Copy link
Copy Markdown
Contributor

docs/feat: Document contract error codes and add backend error mapping


Summary

Contract error codes were undocumented and incompletely surfaced. The backend
returned raw Soroban errors without decoding contract-specific codes, leaving
API consumers with no actionable information on failure. This PR closes both
gaps with a complete error code reference and a backend mapping layer.


Root Cause

Two independent gaps compounded the problem:

  • The error code table in documentation was incomplete, with no stability
    guidance or trigger conditions described per code
  • Backend contract-invoking routes surfaced raw Soroban errors directly,
    with no decoding step to translate contract error codes into user-facing
    messages

###Changes made

1. Error code documentation
Added a complete error code reference table covering:

Column Detail
Error code Canonical contract error identifier
Trigger condition When and why the contract emits this error
Stability guidance Whether the code is stable, provisional, or subject to change

2. Contract error mapping helper
Implemented a dedicated helper that decodes raw Soroban contract error codes
into structured, user-facing messages.

3. Route integration
Applied the mapping helper across all contract-invoking backend routes,
replacing raw Soroban error passthrough with decoded responses.


Impact

Area Before After
Error code documentation ⚠️ Incomplete ✅ Complete with stability guidance
Backend error surface ❌ Raw Soroban errors ✅ Decoded user-facing messages
Contract-invoking routes ❌ Unhandled passthrough ✅ Mapped via shared helper

Closes #58

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

@MickeeJay Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dev-fatima-24 dev-fatima-24 merged commit e7b9a7f into dev-fatima-24:main Apr 29, 2026
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.

SC-018 · Document all contract error codes

2 participants