This patch replaces the Result<_, Optionanyhow::Error> with a proper error.
This simplifies the setup code a bit. The only changed behaviour is that
when rad does not exit successfully, an error is returned instead of
Some(error), which does not alter the behaviour of this binary, because
it would exit the process anyways, but now “rad binary failed” is
printed as well.
This patch replaces the Result<_, Optionanyhow::Error> with a proper error.
This simplifies the setup code a bit. The only changed behaviour is that
when rad does not exit successfully, an error is returned instead of
Some(error), which does not alter the behaviour of this binary, because
it would exit the process anyways, but now “rad binary failed” is
printed as well.
Introduce proper error types and bring back old behaviour.
Thanks for the contribution! Although I’m in favor of improving the error handling, I’m still not convinced by the additional error message that is now printed:
❯ cargo run -q remote show
✗ Error: rad remote: unknown operation 'show'
✗ Error: rad-tui: rad binary failed
The goal of having the optional error was to not print that error message. I think if rad-tui is meant to act as a drop-in replacement, it should only print the error that was returned from rad.
But still, improving semantics here would be good. So I took the chance to advance your changes and introduce proper error types in a new revision.
Improves error names
Fixed sign-off.