Appropriate Token error #290
Open
Sundraiz-Shah wants to merge 4 commits into
Open
Conversation
This was
linked to
issues
Jun 9, 2026
e4e1c8e to
5ff617f
Compare
…4Energy/SMECS into 240-Appropriate-token-error
Aidajafarbigloo
requested changes
Jun 11, 2026
Aidajafarbigloo
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the changes. There are still cases where the system does not display an appropriate error message to the user. Please address this and ensure error handling is consistent across various relevant scenarios, and validate the fix across multiple repositories to cover different cases and conditions.
| headers = {"PRIVATE-TOKEN": token} | ||
| response = requests.get(api_url, headers=headers) | ||
| return response.status_code == 200 | ||
| return {"status": "invalid_url", "message": "Invalid GitLab repository URL format."} |
Collaborator
There was a problem hiding this comment.
returns also for gh repos
| pass | ||
| return { | ||
| "status": "invalid_token", | ||
| "message": "The provided GitLab token is invalid. Please check your token and try again.", |
Collaborator
There was a problem hiding this comment.
Instead I received "Unexpected response from GitLab API (HTTP 400)."
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Before this fix, when something went wrong (wrong token, expired token, wrong URL), the tool would silently fail with a generic or confusing message. Now it tells you exactly what the problem is.
In short: instead of a confusing dead end, you now get a clear message telling you what went wrong and where.
Issue #240 Appropriate error when token is expired (Solved)
Issue #209 Differentiate error between URL and token (Solved)