Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli/rm/rm.go): using panic is not user friendly (#1608)
I manually tested the cli and concluded that it's too easy to reach the panic caused by runtimex.Try0 over there and it would expose panics to users too frequently. Let's just convert those into normal error checks. Here is what we would previously get: ``` % ./ooniprobe rm ? Are you sure you wish to delete the result #0 [Use arrows to move, type to filter] true > false panic: Try0: interrupt [...] ``` So, here I just pressed ^D and got a panic. Ouch! After the diff, we have this: ``` % ./ooniprobe rm ? Are you sure you wish to delete the result #0 false ⨯ failure in main command error=canceled by user ``` and: ``` % ./ooniprobe rm --all ? Are you sure you wish to delete ALL results false ⨯ failure in main command error=canceled by user ``` It seems much better, isn't it? Part of the QA for ooni/probe#2722
- Loading branch information