diff options
| author | Teddy Wing | 2021-06-06 19:56:22 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2021-06-06 19:56:22 +0200 | 
| commit | 304441d496f9d0b04095b56e377d869f41eb38cd (patch) | |
| tree | 690131f7f9dd8fed58e7a8dc540e89ecb572b4c9 /src | |
| parent | 3ec4dcd1e21201a279552a549ba979ee13c07e77 (diff) | |
| download | reflectub-304441d496f9d0b04095b56e377d869f41eb38cd.tar.bz2 | |
main(): Remove `unwrap`
Print the error instead of unwrapping.
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 15 | 
1 files changed, 14 insertions, 1 deletions
| diff --git a/src/main.rs b/src/main.rs index 815d21c..af1319d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,7 +19,20 @@ use std::sync::Arc;  fn main() { -    run().unwrap(); +    match run() { +        Ok(_) => (), +        Err(e) => { +            eprint!("error"); + +            for cause in e.chain() { +                eprint!(": {}", cause); +            } + +            eprintln!(); + +            process::exit(exitcode::SOFTWARE); +        }, +    };  }  fn print_usage(opts: &Options) { | 
