Overview
Issue #124 ("scripts/invoke.mjs doesn't decode Soroban contract error codes back into their named Error variant") is closed, but invoke.mjs's only error handling is the generic top-level catch:
main().catch((err) => {
console.error(err);
process.exit(1);
});
(contracts/scripts/invoke.mjs:52-55). A contract-level rejection (e.g. Error::AlreadyFunded = 5) surfaces to the operator as an opaque XDR/host error object, not as a readable AlreadyFunded name — exactly the usability gap #124 was filed to close. Every contract already has a small, fixed Error enum (contracts/{escrow,milestones,maintenance-pool}/src/error.rs) that a lookup table could map numeric codes back to per-contract.
Requirements
Add error-code-to-name decoding in invoke.mjs's catch path, using a lookup table generated from (or kept in sync with) each contract's error.rs.
Acceptance Criteria
Additional Notes
Verified via direct inspection of contracts/scripts/invoke.mjs:52-55 (no decoding logic present). Cross-reference: #124 (closed).
Overview
Issue #124 ("scripts/invoke.mjs doesn't decode Soroban contract error codes back into their named Error variant") is closed, but
invoke.mjs's only error handling is the generic top-level catch:(
contracts/scripts/invoke.mjs:52-55). A contract-level rejection (e.g.Error::AlreadyFunded = 5) surfaces to the operator as an opaque XDR/host error object, not as a readableAlreadyFundedname — exactly the usability gap #124 was filed to close. Every contract already has a small, fixedErrorenum (contracts/{escrow,milestones,maintenance-pool}/src/error.rs) that a lookup table could map numeric codes back to per-contract.Requirements
Add error-code-to-name decoding in
invoke.mjs's catch path, using a lookup table generated from (or kept in sync with) each contract'serror.rs.Acceptance Criteria
Errorvariant (e.g.AlreadyFunded) when the failure is a contract error, not just a raw error objectAdditional Notes
Verified via direct inspection of
contracts/scripts/invoke.mjs:52-55(no decoding logic present). Cross-reference: #124 (closed).