aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2021-05-23 00:39:31 +0200
committerTeddy Wing2021-05-23 00:39:31 +0200
commit4b71bd433239739a104a7a3fe6b4aba4a2ad66e6 (patch)
tree594b927ba844a24720e1f461ac73111650a4eff1
parent1d74a82aefdbc9936ee662c57dcdd8fa8364918a (diff)
downloadgoogle-calendar-rsvp-4b71bd433239739a104a7a3fe6b4aba4a2ad66e6.tar.bz2
Don't print root_cause if there's only one error in the chain
If there's only one error in the chain, it prints: error: no matches for event ID: no matches for event ID Now, it will print: error: no matches for event ID and: error: unable to open OAuth secret file: Not a directory (os error 20)
-rw-r--r--src/main.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 5298c30..36c2b27 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -42,7 +42,13 @@ async fn main() {
match run().await {
Ok(_) => (),
Err(e) => {
- eprintln!("error: {}: {}", e, e.root_cause());
+ eprint!("error");
+
+ for cause in e.chain() {
+ eprint!(": {}", cause);
+ }
+
+ eprintln!();
process::exit(exitcode::SOFTWARE);
},