Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add the version of python-gitlab to GitlabError #2093

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovos JohnVillalovos commented Jun 25, 2022

People will post tracebacks of exceptions but not post information on
the version of python-gitlab used.

Add the version of python-gitlab to the GitlabError exception message.

@nejch
Copy link
Member

nejch commented Jun 25, 2022

Thanks @JohnVillalovos! This is a specific implementation for one exception. If we do this, a more generic approach might be useful I think, otherwise we might have to litter our code with custom exception messages.

But I'm also not sure if exception messages are the right place for this. Did you get this idea from existing libraries? I think we should look into #2080, maybe in combination with exception hooks if we want this 🤔 not sure, it just seems more like a logging topic IMO?

@JohnVillalovos JohnVillalovos marked this pull request as draft June 25, 2022 16:30
@JohnVillalovos
Copy link
Member Author

Good idea. Let me explore having it in the base GitlabExeception class. But probably not today...

People will post tracebacks of exceptions but not post information on
the version of python-gitlab used.

Add the version of python-gitlab to the GitlabError exception message.
@codecov-commenter
Copy link

Codecov Report

Merging #2093 (7577c91) into main (f9b7c7b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2093   +/-   ##
=======================================
  Coverage   94.72%   94.73%           
=======================================
  Files          78       78           
  Lines        5083     5088    +5     
=======================================
+ Hits         4815     4820    +5     
  Misses        268      268           
Flag Coverage Δ
cli_func_v4 82.42% <80.00%> (-0.01%) ⬇️
py_func_v4 81.19% <100.00%> (+0.01%) ⬆️
unit 85.84% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gitlab/exceptions.py 100.00% <100.00%> (ø)

@JohnVillalovos JohnVillalovos changed the title chore: add the version of python-gitlab to Exception chore: add the version of python-gitlab to GitlabError Jun 26, 2022
@nejch
Copy link
Member

nejch commented Jun 26, 2022

Good idea. Let me explore having it in the base GitlabExeception class. But probably not today...

I would also look at https://stackoverflow.com/questions/5191830/how-do-i-log-a-python-error-with-debug-information as a clean option. Of course, we'd need a nicer setup for #2080 first.

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.

None yet

3 participants