-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add Descriptive Error Message to Upgrade Command #752
Conversation
cmd/upgrade.go
Outdated
|
||
https://exercism.io/faqs`, err) | ||
} | ||
return err |
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.
Seeing as we check for the error above lets return fmt.Errorf(...) within the condition and just return nil
here.
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.
@farisj thanks for your change! The code looks good, just a few nitpicks.
Regarding the rewording of the error message I suggest that you take a look at the error messaging for other commands (e.g download or submit) to get a sense of tone and general formatting.
Happy Hacktoberfest 🎉
cmd/upgrade.go
Outdated
return updateCLI(c) | ||
err := updateCLI(c) | ||
if err != nil { | ||
err = fmt.Errorf(`We were not able to upgrade the cli because we encountered an error: %s |
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.
No need to reassign err
here. Lets return the error message immediately to fail the command.
This is how the current error message will be displayed to the user.
Error: We were not able to upgrade the cli because we encountered an error: <error message>
Please check the FAQ for solutions to common upgrading issues.
Could you move the message down one line and reword the messaging a bit so that it doesn't contain error:
.
Error:
We were not able to upgrade the cli....
<error message>
Please check the FAQ for solutions to common upgrading issues.
https://exercism.io/faqs
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! Thanks for making the update. I’m going to approve since the changes to the website-copy repo were approved. I’ll merge and cut a release once the FAQs are updated.
Hi there! I'm an exercism user but first time contributor. Happy Hacktoberfest! 😄 🎃
What This Does
Solves #680
This PR adds a wrapper around the
exercism upgrade
command which provides a more human-readable error message along with instructions to visit the FAQ page.Currently, the FAQ page does not yet have upgrade debugging solutions, so perhaps it would be best to wait until exercism/website-copy#417 is merged as well.
Thanks for taking the time to read this PR!