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

  1. rupesh-kumar-sah commented on Sep 17, 2026

    @rupesh-kumar-sah

    Hi there,

    I would love to take this on. My planned approach:

    • Structure Soroban contract handlers for invoke.mjs still doesn't decode Soroban contract error codes into their named Error variant — #124 closed without the fix landing following project idioms and storage invariants.
    • Ensure contract compiles cleanly and passes all cargo tests without warnings.

    Happy to pick this up today—please assign to me!

  2. teejayboy4tony-sketch commented on Sep 27, 2026

    @teejayboy4tony-sketch

    @teejayboy4tony-sketch has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hey maintainer, I have worked on an issue similar to this before. Please assign it to me and I’ll submit the PR in no time, ready to merge. I have experience with JavaScript, Soroban tooling, contract error handling, and CLI development, and I can add contract error-code decoding to invoke.mjs with synchronized lookup mappings and graceful fallbacks for non-contract failures. ETA: 2–4 hours.

    Kindly assign this issue to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @teejayboy4tony-sketch to this issue.

  3. aduagba4133 commented on Sep 27, 2026

    @aduagba4133

    @aduagba4133 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I am a detail-oriented and reliable individual with strong skills in research, data entry, online tasks, and following instructions. I am committed to delivering accurate and high-quality work within deadlines and am available to start tasks immediately.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @aduagba4133 to this issue.

  4. Mainnet-ops commented on Sep 27, 2026

    @Mainnet-ops

    @Mainnet-ops has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Can I work on this task?

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Mainnet-ops to this issue.

  5. drips-wave commented on Sep 27, 2026

    @drips-wave

    Congratulations, @Mainnet-ops! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

    🧑‍💻 @Mainnet-ops: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  6. grantfox-oss commented on Sep 29, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @Mainnet-ops's PR #428 was approved and merged by @chonilius.

    🏆 @Mainnet-ops: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (764 total points). Track your full progress on GrantFox.

    👏 Great work, @Mainnet-ops! Keep contributing to MergeFi.

  7. drips-wave commented on Sep 29, 2026

    @drips-wave

    This issue has been completed by @Mainnet-ops as part of the Stellar Wave Program's 9th Wave 🥳

    😎 @Mainnet-ops: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

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