Commit a0d6f13
authored
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.proc` now returns a `result` instead of `unit`, which is a breaking change. As such, the code that depends on this function - such as `clone_repo` in `Tui.Init` was 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:
- The return type of `Shell.proc` is `(unit, string) result`. I am not really sure about crafting the error message there.
- `clone_repo` currently 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 a `result` as well (as it is fallible) and let a public function exit on failure.
1 parent 464691e commit a0d6f13
3 files changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
5 | 13 | | |
6 | 14 | | |
7 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
0 commit comments