-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fix panic in check:configuration command #270
Conversation
@t-hale you will have to gpg sign your commits for me to merge this. Thanks! |
done |
@t-hale on your open question. By default it is true because this tool is majorly used for testing the rosetta implementation locally. For a user who is testing that, it's good to see the errors right away so that they can fix their implementation quickly. This helps in faster turnaround. We could think of a way where we dump detailed error in a file but till then I think default spitting the stack makes sense. Does it makes sense? lmk your thoughts. |
@shrimalmadhur I agree that the errors should be shown quickly and easily for the user to diagnose. In the situation dealing with the
I get a substantial amount of output (error message, stack trace, error message, usage and the error message again)
This is probably due to my unfamiliarity with the CLI, but it seems like we can cut down on the output logging a bit and use the MarkFlagRequired() function to handle this sooner / automatically within cobra. Are there situations where some of the global flags are required for certain commands, but not for others? |
@t-hale I think the configuration file ( |
Motivation
This PR addresses #269
Solution
Just adds a nil check around https://github.com/coinbase/rosetta-cli/blob/master/pkg/results/construction_results.go#L316
Open questions
I generally don't like for users to see stack traces at all (especially in this case where cobra provides the usage message and a meaningful error). Have you considered making
ErrorStackTraceDisabled
set totrue
by default so that the user only sees the usage message, descriptive error and a nonzero return code?