summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-11-24 12:30:40 +0200
committerLars Wirzenius <liw@liw.fi>2022-11-24 12:30:40 +0200
commit66b0ec96b9ab6b8d15b8663e8f95d693c4ce7dcf (patch)
tree0603d290dd2e77b7b8c7ef76804b3c26b1972bcf
parenta551039a40cc1d936f757578fa70101385af4fed (diff)
downloadenterprise-hello-66b0ec96b9ab6b8d15b8663e8f95d693c4ce7dcf.tar.gz
add error chainHEADmain
Sponsored-by: author
-rw-r--r--src/main.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index ceb34da..71a3709 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,13 @@
+use std::error::Error;
+
fn main() {
if let Err(e) = fallible_main() {
eprintln!("ERROR: {}", e);
+ let mut err = e.source();
+ while let Some(underlying) = err {
+ eprintln!("caused by: {}", underlying);
+ err = underlying.source();
+ }
}
}