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

Audit command-line input parsing for obtuse errors #33

Open
hawkw opened this issue Oct 26, 2017 · 0 comments
Open

Audit command-line input parsing for obtuse errors #33

hawkw opened this issue Oct 26, 2017 · 0 comments
Milestone

Comments

@hawkw
Copy link
Contributor

hawkw commented Oct 26, 2017

Potential follow-on from #31 .

For example, passing a nonsense string to --lengthPercentiles sometimes gets me this:

panic: runtime error: index out of range

goroutine 1 [running]:
github.com/buoyantio/strest-grpc/client/percentiles.ParsePercentiles(0x7fff5fbff873, 0x4, 0x0, 0x0, 0x0)
        /Users/eliza/Code/go/src/github.com/buoyantio/strest-grpc/client/percentiles/percentiles.go:38 +0x2bb
github.com/buoyantio/strest-grpc/client.Config.Run(0x151fbe2, 0xe, 0x0, 0x0, 0x1, 0x1, 0x0, 0x0, 0x2540be400, 0x1519c9e, ...)
        /Users/eliza/Code/go/src/github.com/buoyantio/strest-grpc/client/client.go:388 +0x233
github.com/buoyantio/strest-grpc/cmd.glob..func1(0x17e0a00, 0xc4200496a0, 0x0, 0x1)
        /Users/eliza/Code/go/src/github.com/buoyantio/strest-grpc/cmd/client.go:17 +0x5a
github.com/buoyantio/strest-grpc/vendor/github.com/spf13/cobra.(*Command).execute(0x17e0a00, 0xc420049680, 0x1, 0x1, 0x17e0a00, 0xc420049680)
        /Users/eliza/Code/go/src/github.com/buoyantio/strest-grpc/vendor/github.com/spf13/cobra/command.go:702 +0x2c6
github.com/buoyantio/strest-grpc/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x17e0c20, 0x17e66d0, 0xc420125f70, 0x1006164)
        /Users/eliza/Code/go/src/github.com/buoyantio/strest-grpc/vendor/github.com/spf13/cobra/command.go:783 +0x30e
github.com/buoyantio/strest-grpc/vendor/github.com/spf13/cobra.(*Command).Execute(0x17e0c20, 0x24, 0xc4201701e0)
        /Users/eliza/Code/go/src/github.com/buoyantio/strest-grpc/vendor/github.com/spf13/cobra/command.go:736 +0x2b
main.main()
        /Users/eliza/Code/go/src/github.com/buoyantio/strest-grpc/main.go:11 +0x31

It would be nice to hook as much of this as possible into Cobra's validation?

@hawkw hawkw added this to the 1.0 milestone Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant