chore: add authentication type to GitlabAuthenticationError by JohnVillalovos · Pull Request #1793 · python-gitlab/python-gitlab
Repository navigation
chore: add authentication type to GitlabAuthenticationError - #1793
Draft
JohnVillalovos wants to merge 1 commit into main from jlvillal/auth_token_type
Draft
chore: add authentication type to GitlabAuthenticationError #1793 JohnVillalovos wants to merge 1 commit into main from jlvillal/auth_token_type
Conversation
JohnVillalovos commented Jan 2, 2022
Copy link Copy Markdown
Member
Add the type of authentication used to the GitlabAuthenticationError
exception. Hopefully this will make it easier to help user's debug
authentication issues they run into.
codecov-commenter
commented
Jan 2, 2022
·
edited by codecov
Bot
Loading
Copy link Copy Markdown
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@ ## main #1793 +/- ## ========================================== + Coverage 92.02% 92.04% +0.01% ========================================== Files 76 76 Lines 4790 4801 +11 ========================================== + Hits 4408 4419 +11 Misses 382 382
Flags with carried forward coverage won't be shown. Click here to find out more.
|
51573dc to
f1239fd
Compare
January 3, 2022 06:41
chore: add authentication type to GitlabAuthenticationError
cce2202
Add the type of authentication used to the GitlabAuthenticationError exception. Hopefully this will make it easier to help user's debug authentication issues they run into.JohnVillalovos force-pushed the jlvillal/auth_token_type branch from
f1239fd to
cce2202
Compare
January 4, 2022 05:42 nejch reviewed Jan 22, 2022
View reviewed changes
nejch left a comment · edited Loading
Copy link Copy Markdown
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
Thanks John! Just a few ideas from my side on this one :) At the beginning I wasn't quite sure about the use case for this, but for authentication errors might be handy with all the job token confusion.
Especially with the job token we could add a link to the endpoints available or something (e.g. have a mapping for the error message).
Comment thread gitlab/exceptions.py Comment on lines +55 to +67| def __init__( | ||
| self, | ||
| error_message: Union[str, bytes] = "", | ||
| response_code: Optional[int] = None, | ||
| response_body: Optional[bytes] = None, | ||
| auth_type: str = "", | ||
| ) -> None: | ||
| super().__init__( | ||
| error_message=error_message, | ||
| response_code=response_code, | ||
| response_body=response_body, | ||
| ) | ||
| self.auth_type = auth_type |
| response_code=result.status_code, | ||
| error_message=error_message, | ||
| response_body=result.content, | ||
| auth_type=self.auth_type, |
|
|
||
| def __str__(self) -> str: | ||
| if self.auth_type: | ||
| return f"{super().__str__()}: authentication_type: {self.auth_type}" |
github-actions
Bot
commented
Jul 9, 2025
Copy link Copy Markdown
|
This Pull Request (PR) was marked stale because it has been open 90 days with no activity. Please remove the stale label or comment on this PR. Otherwise, it will be closed in 15 days. |
Bot
added stale and removed stale labels Jul 9, 2025
github-actions
Bot
commented
Oct 9, 2025
Copy link Copy Markdown
|
This Pull Request (PR) was marked stale because it has been open 90 days with no activity. Please remove the stale label or comment on this PR. Otherwise, it will be closed in 15 days. |
Bot
added stale and removed stale labels Oct 9, 2025
github-actions
Bot
commented
Jan 8, 2026
Copy link Copy Markdown
|
This Pull Request (PR) was marked stale because it has been open 90 days with no activity. Please remove the stale label or comment on this PR. Otherwise, it will be closed in 15 days. |
Bot
added the stale label Jan 8, 2026 JohnVillalovos self-assigned this Jan 8, 2026 JohnVillalovos removed the stale label Nov 14, 2026
This branch has not been deployed
No deployments
Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment