-
Notifications
You must be signed in to change notification settings - Fork 273
Better goto-instrument error reporting for missing files #4195
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
Better goto-instrument error reporting for missing files #4195
Conversation
In the past, goto-instrument was failing with the default --help error message if it didn't get the correct number of positional arguments, making it unnecessarily hard to understand what was failing and why (since the help message is long and it also didn't have any particular signaling for what went wrong). This makes it so that it reports it as an invalid user input exception. Fixes diffblue#2861.
Before the change, this looked like this:
Notice how there's no indicator of any failed process, and it's nearly indistinguishible from a successful execution (aside from an extra
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Maybe we could throw an exception as well right at the beginning in doit()
when cmdline.args.size()!=1 && cmdline.args.size()!=2
holds.
"Invalid number of positional arguments passed", | ||
"[in] [out]", | ||
"goto-instrument needs one input and one output file, aside from other " | ||
"flags"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also maybe add an additional line here to say "use goto-instrument --help for additional help" or something similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: fd5b9c0).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/101077690
In the past, goto-instrument was failing with the default
--help
error message if it didn't get the correct number of positional arguments, making it unnecessarily hard to understand what was failing and why (since the help message is long and it also didn't have any particular signalling for what went wrong). This makes it so that it reports it as an invalid user input exception. Fixes #2861.