Be more helpful when generator can not be found#646
Merged
kotp merged 4 commits intoexercism:masterfrom May 21, 2017
Merged
Conversation
Improve error output by providing information about where it expects to find the generator cases file.
kotp
reviewed
May 21, 2017
| $stderr.puts "A generator does not currently exist for #{options[:slug]}!" | ||
| error_message = "A generator does not currently exist for #{options[:slug]}!" | ||
| expected_locations = "Expecting it to be at: #{Files::GeneratorCases.source_filepath(@paths.track, options[:slug])}" | ||
| $stderr.puts [error_message, expected_locations].join("\n") |
Member
There was a problem hiding this comment.
This isn't raising so error_message should probably be simply message.
Member
|
Looks good to me, other than the variable name. I looked for where it was raising, and couldn't find it, so it caused me some extra "investigation" to realize that it was not going to do that... the name leads me to search, without it, I know it is just a message with no further expectations, other than perhaps output somewhere. |
Since we're not actually raising an error, just outputting a warning message to $stderr.
kotp
reviewed
May 21, 2017
| return true if available_generators.include?(options[:slug]) | ||
| $stderr.puts "A generator does not currently exist for #{options[:slug]}!" | ||
| warning = "A generator does not currently exist for #{options[:slug]}!" | ||
| expected_location = "Expecting it to be at: #{Files::GeneratorCases.source_filepath(@paths.track, options[:slug])}" |
Member
|
Thanks @Insti |
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.
Resolves #644
In #583 there was a problem with the generator not being found:
This patch adds a bit more information to the error message about where the generator expected to find the file it needs.