Closed keith-hall closed 2 years ago
Yes I agree the error handling is not user friendly.
It should be fixed in 9a07d59ee21f2ba1a01e380df9703e3df91f0eba, please test.
Nice, much more user-friendly now - thank you!
Do you think it's worth mentioning which handler failed to start? So instead of:
❯ rsp Cargo.toml
ERROR [rsop] Failed to start handler: No such file or directory (os error 2)
it could say something like:
ERROR [rsop] Failed to start "handler_preview" for filetype "text": No such file or directory (os error 2)
if so, I could try to work on a PR for that if you want to save you the trouble/time :)
And I think the exit code still isn't set on failure:
❯ rsp noexist.txt
ERROR [rsop] Failed to read input file or data: No such file or directory (os error 2)
❯ echo $?
0
I think it should set it to a non-zero value like 1 when something goes wrong. I'd be happy to look at making a PR for this too :)
I have made some more improvements in f1f558c45994d4fc48b4c05d7e40cc2c3b59020d.
Wow, this is amazing - thank you so much! :D I consider this issue resolved :)
Hi,
Thanks for this great tool!
I noticed that it currently panics when passing a path which doesn't exist. And also when the relevant
handler_preview
command doesn't exist (andshell
isfalse
). Currently both scenarios look the same from a user perspective which was confusing for me.It would be nice if it just showed a simple (but descriptive) error instead of panicking. (While keeping the exit/return code to indicate failure.) Perhaps something similar to
bat
s approach: