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

Feature Request: print git error explicitly #98

Open
ldeluigi opened this issue Sep 9, 2022 · 5 comments
Open

Feature Request: print git error explicitly #98

ldeluigi opened this issue Sep 9, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@ldeluigi
Copy link

ldeluigi commented Sep 9, 2022

except (InvalidGitRepositoryError, NoSuchPathError) as err:

When an error occurs with git commands, I can't debug the reason.

For example, I can't distinguish between:

  1. git is not installed
  2. not a git repo
  3. git repo is corrupted
  4. git repo owner forbids commands
  5. other

PS. I'd like the same thing for your others git-based mkdocs plugins

@timvink
Copy link
Owner

timvink commented Sep 24, 2022

That's strange, as the actual error is re-raised:

Git errors come from the GitPython dependency, and are raised as-is. I don't have their error handling top of mind -- but perhaps you can create a reproducable example and open an issue there?

@timvink
Copy link
Owner

timvink commented Oct 31, 2022

@ldeluigi small reminder. Can you provide some more details?

@ldeluigi
Copy link
Author

@ldeluigi small reminder. Can you provide some more details?

Yes. I'd like to see the git error even if I enabled fallback_to_build_date. The raise instruction is done only in the else part of the catch clause.

I'd like to see a info message that explains why git fired the error...

@ldeluigi
Copy link
Author

The problem is that I enabled that option only for when a git repo doesn't exist at all. When it does, if something goes wrong, I want to fallback to build date + see what went wrong....

Could you add some code that checks if a .git folder is present and in that case you primt debug info on the git exception?

@timvink
Copy link
Owner

timvink commented Oct 31, 2022

Ahhh, I see! Thanks for clarifying, and yes, logging the error when there's a fallback makes sense. Probably a warning level log is more fitting than a info level log.

@timvink timvink added the enhancement New feature or request label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants