diff options
| author | Teddy Wing | 2021-05-23 00:39:31 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2021-05-23 00:39:31 +0200 | 
| commit | 4b71bd433239739a104a7a3fe6b4aba4a2ad66e6 (patch) | |
| tree | 594b927ba844a24720e1f461ac73111650a4eff1 /src | |
| parent | 1d74a82aefdbc9936ee662c57dcdd8fa8364918a (diff) | |
| download | google-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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 8 | 
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);          }, | 
