From ee3059aa8f738d0dd673d492882fced13a5b9af9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 15 May 2021 20:33:23 +0100 Subject: [PATCH] otter: Do not panic on (most) command execution errors Signed-off-by: Ian Jackson --- src/bin/otter.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index dc531d0f..75016025 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -435,7 +435,14 @@ fn main() { env::args().next().unwrap(), &subcommand)); - call(sc, mo, subargs).expect("execution error"); + call(sc, mo, subargs).unwrap_or_else(|e|{ + eprint!("otter: error"); + for e in e.chain() { + eprint!(": {}", &e); + } + eprintln!(""); + exit(12); + }) } struct Conn { -- 2.30.2