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
Custom errors #576
Comments
I don't think I'd want to stabilize |
kim
added a commit
to kim/git2-rs
that referenced
this issue
Jun 24, 2020
…ust-lang#576) Previously, the propagated error would always be the default "unknown error" as returned by `Error::last_error` if `git_error_last` returns a null pointer. The attached test case is rather trivial, but can be used to reproduce the old and new behaviour.
kim
added a commit
to kim/git2-rs
that referenced
this issue
Jun 24, 2020
Previously, the propagated error from a custom transport would always be the default "unknown error" as returned by `Error::last_error` if `git_error_last` returns a null pointer. The attached test case is rather trivial, but can be used to reproduce the old and new behaviour.
That makes sense, although I'm unsure where to draw the line. I've submitted a PR for the first part, and will ponder on the second for a bit. |
kim
added a commit
to kim/git2-rs
that referenced
this issue
Jun 25, 2020
kim
added a commit
to kim/git2-rs
that referenced
this issue
Jun 25, 2020
kim
added a commit
to kim/git2-rs
that referenced
this issue
Jun 25, 2020
kim
added a commit
to kim/git2-rs
that referenced
this issue
Jun 25, 2020
Previously, the propagated error from a custom transport would always be the default "unknown error" as returned by `Error::last_error` if `git_error_last` returns a null pointer. The attached test case is rather trivial, but can be used to reproduce the old and new behaviour.
kim
added a commit
to kim/git2-rs
that referenced
this issue
Jun 25, 2020
alexcrichton
pushed a commit
that referenced
this issue
Jun 25, 2020
Previously, the propagated error from a custom transport would always be the default "unknown error" as returned by `Error::last_error` if `git_error_last` returns a null pointer. The attached test case is rather trivial, but can be used to reproduce the old and new behaviour.
alexcrichton
pushed a commit
that referenced
this issue
Jun 26, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When developing custom transports, I found it a bit unsatisfying that the only way to construct a custom
git2::Error
is viaError::from_str
-- as the code and class are very generic, it essentially always bubbles up as an "unknown error". I think this means thattransport::subtransport_action
should also calllibgit2_sys::git_error_set_str
, but if that would be the case, it would still be nice to also be able to tweak the code and class (eg. by makingError::from_raw
public).Would you be willing to accept a patch which does these two things?
The text was updated successfully, but these errors were encountered: