Skip to content

Change color to red if the personal access token is invalid #10

Open
@vfonic

Description

@vfonic

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions