Better error message when track/problem can't be identified#261
Merged
kytrinyx merged 3 commits intoexercism:masterfrom Dec 13, 2015
Merged
Better error message when track/problem can't be identified#261kytrinyx merged 3 commits intoexercism:masterfrom
kytrinyx merged 3 commits intoexercism:masterfrom
Conversation
exercises directory, and another for submitting inside the directory but with a bad internal path. The latter might happen if the user messes with their directories inside of their configured exercises directory. We print a detailed message, which is hopefully helpful.
api/iteration.go
Outdated
Member
|
This looks great! I really like the clarity of these error messages, and I think using a text/template was a really good call. I have a few minor comments. |
the slashes like `\` instead of `/`. This requires passing an additional Separator variable to our template.
Contributor
Author
|
I think this is done. Please review when you are able. |
Member
|
Thanks so much for taking the time to work through this so thoroughly! |
kytrinyx
added a commit
that referenced
this pull request
Dec 13, 2015
Better error message when track/problem can't be identified
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.
I've created two error messages for two scenarios.
submitis called outside of the configured exercises directory, use themsgSubmitCalledFromWrongDirtemplatesubmitis called inside the configured exercises directory, but the path seems weird, usemsgGenericPathErrortemplate. I was able to simulate this error like this:Happy to rework any of this. 🎅 🎄 🎁
I used
text/templatebecause the messages were quite long. TheiterationErrortype is not necessary, strictly speaking, but I'd like to know what the rest of the team thinks.It was mentioned in #197 that we could suggest the proper path. I am unsure how to do that without having some kind of lookup based on file extension and the exercise slug. Even if I know that the file they're trying to submit is JavaScript, how can I tell it's the
hello-worldproblem when they're submitting from a bad path/location?