Skip to content

fix: handle an invalid GitHub token - #206

Merged
dwilding merged 1 commit into
mainfrom
catch-bad-token
Oct 27, 2026
Merged

dwilding merged 1 commit into
mainfrom
catch-bad-token

Conversation

@dwilding

Copy link
Copy Markdown
Owner

Currently, if an invalid token is provided in GIMMEGIT_GITHUB_TOKEN, gimmegit crashes:

Getting repo details
Traceback (most recent call last):
  File "/home/me/.local/bin/gimmegit", line 10, in <module>
    sys.exit(main())
             ~~~~^^
...
    raise self.createException(status, responseHeaders, data)
github.GithubException.BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest", "status": "401"}

This PR catches the error and outputs a friendly message:

Error: GitHub rejected the token. Has the token expired?

@dwilding
dwilding merged commit 280e3d8 into main Oct 27, 2026
14 checks passed
@dwilding
dwilding deleted the catch-bad-token branch October 27, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant