aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2021-06-06 19:56:22 +0200
committerTeddy Wing2021-06-06 19:56:22 +0200
commit304441d496f9d0b04095b56e377d869f41eb38cd (patch)
tree690131f7f9dd8fed58e7a8dc540e89ecb572b4c9 /src
parent3ec4dcd1e21201a279552a549ba979ee13c07e77 (diff)
downloadreflectub-304441d496f9d0b04095b56e377d869f41eb38cd.tar.bz2
main(): Remove `unwrap`
Print the error instead of unwrapping.
Diffstat (limited to 'src')
-rw-r--r--src/main.rs15
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) {