cp8_cli icon indicating copy to clipboard operation
cp8_cli copied to clipboard

Error message when Github token is invalid

Open sogamoso opened this issue 5 years ago • 2 comments

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.

sogamoso avatar Nov 21 '19 14:11 sogamoso

Similarly, for GitHub tokens with insufficient privileges.

radeklat avatar Apr 07 '20 13:04 radeklat

Sounds like a good idea 👍

balvig avatar Apr 15 '20 06:04 balvig