Skip to content

feat(BE-47): unified Soroban contract error mapping (#506)#512

Merged
Cedarich merged 1 commit into
Pulsefy:mainfrom
Nonso-Eze:feat/be-soroban-error-mapping
May 30, 2026
Merged

feat(BE-47): unified Soroban contract error mapping (#506)#512
Cedarich merged 1 commit into
Pulsefy:mainfrom
Nonso-Eze:feat/be-soroban-error-mapping

Conversation

@Nonso-Eze
Copy link
Copy Markdown
Contributor

Map Soroban contract failures to stable API error codes so frontend/mobile can show clear, consistent error UX.

  • Add SorobanErrorCode enum covering auth, pause, escrow state, balance, version mismatch, admin, input validation, budget, and unknown errors
  • Implement mapSorobanError() replacing the old mapSimulationError() with stable codes clients can switch on
  • Wire transaction.service to use the new mapper; RESTORE_REQUIRED now uses SorobanErrorCode enum value
  • Add 30 unit tests covering all top-level contract error scenarios plus unknown/unexpected failures
  • request_id is always present via GlobalHttpExceptionFilter (unchanged)

Closes #506

Map Soroban contract failures to stable API error codes so frontend/mobile
can show clear, consistent error UX.

- Add SorobanErrorCode enum covering auth, pause, escrow state, balance,
  version mismatch, admin, input validation, budget, and unknown errors
- Implement mapSorobanError() replacing the old mapSimulationError() with
  stable codes clients can switch on
- Wire transaction.service to use the new mapper; RESTORE_REQUIRED now
  uses SorobanErrorCode enum value
- Add 30 unit tests covering all top-level contract error scenarios plus
  unknown/unexpected failures
- request_id is always present via GlobalHttpExceptionFilter (unchanged)

Closes Pulsefy#506
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@Nonso-Eze 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

@Cedarich Cedarich merged commit 22600b3 into Pulsefy:main May 30, 2026
1 check passed
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.

BE-47: Unified Contract Error Mapping (Soroban Errors → API Error Codes)

2 participants