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

soroban-cli: should return non-zero exit code when can't find data #920

Closed
2 tasks done
leighmcculloch opened this issue Sep 1, 2023 · 2 comments · Fixed by #924
Closed
2 tasks done

soroban-cli: should return non-zero exit code when can't find data #920

leighmcculloch opened this issue Sep 1, 2023 · 2 comments · Fixed by #924
Assignees
Labels
bug Something isn't working

Comments

@leighmcculloch
Copy link
Member

leighmcculloch commented Sep 1, 2023

What version are you using?

What did you do?

soroban contract read --network local --source me --id CAW7SH5JG45U6YLCFB6YD2KVSOZQHMNEJQPN6KDZOCGSXWR72ZIFBBMP --key abc

What did you expect to see?

An error because no contract data or ledger entry is stored with that key.

What did you see instead?

Nothing. No output.

Discussion

It's difficult to compose tools that don't exit with a non-zero code in failure cases.

From a UX point-of-view the user can be left feeling uneasy when a tool returns or outputs nothing.

Tasks

Preview Give feedback
  1. tsachiherman
  2. tsachiherman
@leighmcculloch leighmcculloch added the bug Something isn't working label Sep 1, 2023
@willemneal
Copy link
Member

The exit code issue is also noted here: #774

Currently in the main.rs when doing a run it catches the error and prints it, but doesn't exit with a non-zero code. So this seems like two issues. I agree that there should be a proper error, but I think we should also exit with a non-zero so that scripts and other programs invoking the CLI will know there has been an error.

@tsachiherman
Copy link
Contributor

I agree with @willemneal here. The fact that the empty group isn't being reported as an error in this particular case is an issue - but not the same issue not setting the exit code to 1. Let's tackle these separately ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants