Skip to content

invoke.mjs still doesn't decode Soroban contract error codes into their named Error variant — #124 closed without the fix landing #296

Description

@abayomicornelius

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

  • A failed invocation prints the named Error variant (e.g. AlreadyFunded) when the failure is a contract error, not just a raw error object
  • Falls back gracefully for non-contract errors (network/auth failures)

Additional Notes

Verified via direct inspection of contracts/scripts/invoke.mjs:52-55 (no decoding logic present). Cross-reference: #124 (closed).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions