vscode-github-notifications-bell
vscode-github-notifications-bell copied to clipboard
Change color to red if the personal access token is invalid
I just tried setting invalid github token and realized that I didn't get any errors back.
This happens here: https://github.com/fabiospampinato/vscode-github-notifications-bell/blob/master/src/statusbar.ts#L70
When API token is correct, the response is an array of notifications:
JSON.parse ( result[0].body ) // => [{...}, {...}]
When API token is incorrect, the response is an object:
JSON.parse ( result[0].body ) // => {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}
It would be useful for user to know that they didn't set the token right.