Add command and args to execvp error message#7511
Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom Mar 12, 2019
Merged
Add command and args to execvp error message#7511straight-shoota merged 1 commit intocrystal-lang:masterfrom
straight-shoota merged 1 commit intocrystal-lang:masterfrom
Conversation
bcardiff
approved these changes
Mar 5, 2019
sdogruyol
approved these changes
Mar 5, 2019
yxhuvud
reviewed
Mar 5, 2019
| # FIXME: Oddly doubled error message | ||
| expect_raises_errno(Errno::ENOENT, "execvp: No such file or directory: No such file or directory") do | ||
| Process.new("foobarbaz") | ||
| expect_raises_errno(Errno::ENOENT, %(execvp (foobarbaz "foo"): No such file or directory: No such file or directory)) do |
Contributor
There was a problem hiding this comment.
Does the printed command need a length restriction? If it has many arguments, then there could be some issues with the usability.
Member
Author
There was a problem hiding this comment.
Restricting the length could also have usability implications. The best solution would be to change the order and print the failed command after the libc error message. Errno doesn't support that though.
urde-graven
pushed a commit
to urde-graven/crystal
that referenced
this pull request
Mar 20, 2019
* 'master' of github.com:crystal-lang/crystal: Change the font-weight used in Playground (crystal-lang#7552) Fix formatting absolute paths (crystal-lang#7560) Refactor IO::Syscall as IO::Evented (crystal-lang#7505) YAML: fix test checking serialization of slices for libyaml 0.2.2 (crystal-lang#7555) Let Array#sort only use `<=>`, and let `<=>` return `nil` for partial comparability (crystal-lang#6611) Update `to_s` and `inspect` to have similar signatures accross the stdlib (crystal-lang#7528) Fix restriction of valid type vs free vars (crystal-lang#7536) Rewrite macro spec without executing a shell command (crystal-lang#6962) Suggest `next` when trying to break from captured block (crystal-lang#7406) Fix GenericClassType vs GenericClassInstanceType restrictions (crystal-lang#7537) Add human readable formatting for numbers (crystal-lang#6314) Add command and args to execvp error message (crystal-lang#7511) Implement Set#add? method (crystal-lang#7495)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
LibC.execvpfails, it would previously raise anErrnowith messageexecvpfollowed by the reason of failure (for exampleNo such file or directory). But that's not a great help for debugging, unless you know which command was to be executed.This PR adds the command and it's arguments to the error message. I'm not sure if the arguments are really necessary.
Related to #7508