GH-55: Provide a better error message in case of failure while cloning the repository #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #55
Before this commit, the function that handled invoking the cloning command did not perform any error handling.
This PR attempts to fix that ; this means that
Shell.procnow returns aresultinstead ofunit, which is a breaking change. As such, the code that depends on this function - such asclone_repoinTui.Initwas updated to handle the result and exit with a better error message (well, at least one that is more useful).Things that I am still not convinced about in this fix:
Shell.procis(unit, string) result. I am not really sure about crafting the error message there.clone_repocurrently exits, but since it is an "internal" function (it is not exposed in the interface of the module), it is probably safer to make it return aresultas well (as it is fallible) and let a public function exit on failure.