Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upIs gitdb an implementation detail? #933
Comments
Yes, |
Those are GitPython's requirements, though, not my requirements... |
Thanks for posting! I believe this is indeed an issue, and it's worth fixing for better usability and less surprises. I believe everyone would benefit by removing or merging GitDB into GitPython for good, and PRs are very welcome. |
That sounds like a big task... In the meantime, maybe something like this could suffice: try:
gitdb.op()
except gitdb.exc.ODBError as exc:
raise git.exc.GitDBError from exc Actually though, I just realized that GitPython (not GitDB) is raising Line 147 in 23b83cd So, maybe more like: class BadName(git.exc.GitError, gitdb.exc.BadName):
pass
raise BadName(name) edit: FWIW, my workaround is to catch Line 8 in 23b83cd |
@tucked Wow, fantastic write up! I would be so happy if this could be fixed for everyone with what seems like a small PR. (Still catching up on emails, maybe the PR is already there) |
This raises
gitdb.exc.BadName
(which is not catchable withgit.exc.GitError
"Base class for all package exceptions").Do I need to catch
gitdb
exceptions too? I don't have a dep ongitdb
otherwise.