-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
Extend the documentation with respect to the exceptions being raised by various functions #531
Comments
Fixed how? Without knowing what you expect it to do, it's not possible to provide any kind of fix.
|
Basically it's up to you. If you are OK with the |
Python usually raises |
I believe that |
Let me make the bug report broader.
Maybe it would be worth mentioning what happens if another process removes the repository files in the meantime as well. |
One possibility would be to also use custom-class errors allowing consumer to catch the high-level exception (from which all pygit2 exceptions inherit) and display the corresponding error message |
I just started experimenting with pygit2 and pretty much the first thing you run into (just running the example code) is that This is unexpected for three reasons:
Throwing an exception at all for a normal case of looking-for-and-not-discovering a repository was surprising, but a Of course |
Now it returns This issue became broader than just |
👍
I think it's fine if a function that creates files throws an The other approach is to catch and wrap everything that comes out of your library in a library-specific exception, and not just |
0.27.1 (2018-06-02) ------------------------- Breaking changes: - Now ``discover_repository`` returns ``None`` if repository not found, instead of raising ``KeyError`` `#531 <https://github.com/libgit2/pygit2/issues/531>`_ Other changes: - New ``DiffLine.raw_content`` `#610 <https://github.com/libgit2/pygit2/issues/610>`_ - Fix tests failing in some cases `#795 <https://github.com/libgit2/pygit2/issues/795>`_ - Automatize wheels upload to pypi `#563 <https://github.com/libgit2/pygit2/issues/563>`_
'discover_repository' now returns None when a repository is not found: https://github.com/libgit2/pygit2/blob/master/CHANGELOG.rst#0271-2018-06-02 libgit2/pygit2#531
Closing, follow up in issue #830 |
0.27.2 (2018-09-16) ------------------------- - Add support for Python 3.7 `#809 <https://github.com/libgit2/pygit2/issues/809>`_ - New ``Object.short_id`` `#799 <https://github.com/libgit2/pygit2/issues/799>`_ `#806 <https://github.com/libgit2/pygit2/pull/806>`_ `#807 <https://github.com/libgit2/pygit2/pull/807>`_ - New ``Repository.descendant_of`` and ``Repository.branches.with_commit`` `#815 <https://github.com/libgit2/pygit2/issues/815>`_ `#816 <https://github.com/libgit2/pygit2/pull/816>`_ - Fix repository initialization in ``clone_repository(...)`` `#818 <https://github.com/libgit2/pygit2/issues/818>`_ - Fix several warnings and errors, commits `cd896ddc <https://github.com/libgit2/pygit2/commit/cd896ddc>`_ and `dfa536a3 <https://github.com/libgit2/pygit2/commit/dfa536a3>`_ - Documentation fixes and improvements `#805 <https://github.com/libgit2/pygit2/pull/805>`_ `#808 <https://github.com/libgit2/pygit2/pull/808>`_ 0.27.1 (2018-06-02) ------------------------- Breaking changes: - Now ``discover_repository`` returns ``None`` if repository not found, instead of raising ``KeyError`` `#531 <https://github.com/libgit2/pygit2/issues/531>`_ Other changes: - New ``DiffLine.raw_content`` `#610 <https://github.com/libgit2/pygit2/issues/610>`_ - Fix tests failing in some cases `#795 <https://github.com/libgit2/pygit2/issues/795>`_ - Automatize wheels upload to pypi `#563 <https://github.com/libgit2/pygit2/issues/563>`_
The function
discover_repository
apparently raisesKeyError
if it cannot find a repository. I think that it is not appropriate and it also is not documented. Could it be fixed, please?The text was updated successfully, but these errors were encountered: