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

Improve cli error handling #51

Closed
suizman opened this issue Oct 11, 2018 · 1 comment
Closed

Improve cli error handling #51

suizman opened this issue Oct 11, 2018 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@suizman
Copy link
Contributor

suizman commented Oct 11, 2018

I've detected whenever we use the cli and it returns an error, Cobra always returns the usage message. Even when we pass the right parameters.

How to reproduce:

$ go run ../main.go -k pepe client membership --key 0 --version 1 -l info     
                                       
QedClient: 2018/10/11 11:00:05.575712 /home/spark/go/src/github.com/bbva/qed/cmd/client_membership.go:53: Querying key [ 0 ] with version [ 1 ]
Error: Unexpected server error
Usage:
  qed client membership [flags]

Flags:
  -h, --help                   help for membership
      --historyDigest string   Digest of the history tree
      --hyperDigest string     Digest of the hyper tree
      --key string             Key to query
      --verify                 Do verify received proof
      --version uint           Version to query

Global Flags:
  -k, --apikey string     Server api key
  -e, --endpoint string   Endpoint for REST requests on (host:port) (default "http://localhost:8080")
  -l, --log string        Choose between log levels: silent, error, info and debug (default "error")

exit status 255

We've seen an possible solution in this Cobra issue

@aalda aalda added this to the v0.2-alpha milestone Apr 2, 2019
@suizman suizman added the bug Something isn't working label Apr 3, 2019
@suizman
Copy link
Contributor Author

suizman commented Apr 3, 2019

Oh, we've fixed this one a month ago 2618bf4 -> spf13/cobra#340

@suizman suizman closed this as completed Apr 3, 2019
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
None yet
Development

No branches or pull requests

2 participants