Closed BapRx closed 7 months ago
If I understand you correctly, you are getting a panic because you're using a git://
or http://
URL, but it's not obvious which repo/remote caused the error because there is no output of its name?
I'd prefer your second approach (having repo::detect_remote_type()
return a proper Result
and handling the error code on the call site). The unimplemented!()
part was just a quick hack during initial development. So the concrete TODOs would be:
repo::detect_remote_type()
to return Result<Option<RemoteType>, String>
or Result<RemoteType, String>
.unimplemented!()
with reuturning an Err
value.repo::detect_remote_type()
(I found two) and properly propagate the error.repo::detect_remote_type()
in src/repo.rs
.What do you think? Feel free to open a PR with the changes.
That's exactly what I had was looking for, I'll try to open a PR when I have the time. Thanks for the TODO :slightly_smiling_face:
That'd would be helpful to identify what path triggers an error before a panic happens, a debug
println!("{path}")
could be added here https://github.com/hakoerber/git-repo-manager/blob/9b4ed2837eca5b9775983aff8871cab31aea7065/src/lib.rs#L27-L28I needed this because of these lines: https://github.com/hakoerber/git-repo-manager/blob/9b4ed2837eca5b9775983aff8871cab31aea7065/src/repo.rs#L490-L495
Another option would be to return an error and handle it correctly in this block https://github.com/hakoerber/git-repo-manager/blob/9b4ed2837eca5b9775983aff8871cab31aea7065/src/lib.rs#L65-L75