cp8_cli
cp8_cli copied to clipboard
Error message when Github token is invalid
When the Github token becomes invalid, the output is not very useful and doesn't tell you what you need to do. It would be nice to improve that.
Context
I just tried to run cp8 start ...
and got an error that required me to look into the source code to find out where the Github token was is stored so that I could update it.
cp8 start https://github.com/cookpad/...issues/2852
Traceback (most recent call last):
...
/.../ruby/gems/2.6.0/gems/octokit-4.14.0/lib/octokit/response/raise_error.rb:16:in `on_complete': GET https://api.github.com/repos/cookpad/.../issues/2852: 401 - Bad credentials // See: https://developer.github.com/v3 (Octokit::Unauthorized)
Proposed solution
Rescue from the error that's being raised (if any) or read the response status code and show an error message such as: "Your Github token is no longer valid, please generate a new one in https://github.com/settings/tokens and update it in ~/.trello_flow" or something along those lines.
Similarly, for GitHub tokens with insufficient privileges.
Sounds like a good idea 👍