From: Ian Jackson Date: Sat, 15 May 2021 19:33:23 +0000 (+0100) Subject: otter: Do not panic on (most) command execution errors X-Git-Tag: otter-0.6.0~262 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ee3059aa8f738d0dd673d492882fced13a5b9af9;p=otter.git otter: Do not panic on (most) command execution errors Signed-off-by: Ian Jackson --- 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 {