Skip to content

Improve CLI error handling and validation for contract invocation arguments #2182

@sagpatil

Description

@sagpatil

Summary

Users encountered unclear errors when invoking contracts via CLI due to mistakes in dynamically assembling argument JSON objects with bash scripts. These errors were hard to spot and troubleshoot.

Context

  • Problems arose from incorrect argument assembly, not struct size.
  • CLI error messages were vague, making debugging difficult.

Proposed Improvements

  • Enhance the CLI to pre-validate JSON arguments before execution and provide more descriptive, human-friendly error messages when issues are detected.
  • Consider adding checks to catch common mistakes (e.g. wrong types, malformed JSON) before invoking the contract, to help users catch errors earlier.
  • Optionally, document best practices for assembling argument objects, especially when using bash scripts or dynamic JSON generation.

Issue based on a recent troubleshooting case (Slack discussion).

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliRelated to Soroban CLIenhancementNew feature or request

    Type

    No type

    Projects

    Status

    Todo (Ready for Dev)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions