Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added type description to errors when using --arg #263

Merged
merged 4 commits into from
Nov 29, 2022

Conversation

waldmatias
Copy link
Contributor

What

Adding what type (Symbol, Byte, etc) a specified argument via the --arg option is trying to be parsed into, and if a parsing error occurs, include it in the error output to provide a hint as to why the arg is unable to be parsed.

Why

Currently, there's a very general and unhelpful error if an error occurs when parsing a val to type.

Known limitations

A simple change, basically to show more error information when specifing --arg.

Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great 👏🏻, and really improves the experience of interacting with args. Great idea.

There's one thing we can do to possibly further improve the output that I note below, but I think this already goes a long way to improve the situation, so we could merge this as is and consider follow ups to continue to improve.

cmd/soroban-cli/src/strval.rs Outdated Show resolved Hide resolved
cmd/soroban-cli/src/strval.rs Outdated Show resolved Hide resolved
@leighmcculloch leighmcculloch enabled auto-merge (squash) November 29, 2022 08:40
@leighmcculloch leighmcculloch merged commit ea55b4b into stellar:main Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants