Context: The Rust SDK defines numeric contract error codes. The backend should translate them to human-readable messages when surfacing RPC simulation errors.
Requirements:
- Create
backend/src/stellar/error-codes.ts mapping numeric codes to string descriptions (manually synced from errors.rs, with a comment pointing to the source file).
- In
stellar.ts, catch simulation errors and include the mapped description in the thrown error message.
Acceptance criteria:
- A simulation failing with code 10 throws
"FundingTargetNotMet: vault has not reached its funding target".
- Unknown codes fall back to
"Contract error code N".
Context: The Rust SDK defines numeric contract error codes. The backend should translate them to human-readable messages when surfacing RPC simulation errors.
Requirements:
backend/src/stellar/error-codes.tsmapping numeric codes to string descriptions (manually synced fromerrors.rs, with a comment pointing to the source file).stellar.ts, catch simulation errors and include the mapped description in the thrown error message.Acceptance criteria:
"FundingTargetNotMet: vault has not reached its funding target"."Contract error code N".