summaryrefslogtreecommitdiff
path: root/src/bin/subplot.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers+gitlab@digital-scurf.org>2022-08-13 16:20:34 +0000
committerDaniel Silverstone <dsilvers+gitlab@digital-scurf.org>2022-08-13 16:20:34 +0000
commite90337da2b293eb0111e6be9131ef2f25e861b9c (patch)
tree22550622adb354a345849f9402ea9299ac4199dc /src/bin/subplot.rs
parentac09169b21d94841eb45736c3ef937ce21283279 (diff)
parent9b3b0087512614d13e8c3b950041101ab649b786 (diff)
downloadsubplot-e90337da2b293eb0111e6be9131ef2f25e861b9c.tar.gz
Merge branch 'liw/refactor-errors' into 'main'
feat: make errors have a source error See merge request subplot/subplot!284
Diffstat (limited to 'src/bin/subplot.rs')
-rw-r--r--src/bin/subplot.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/bin/subplot.rs b/src/bin/subplot.rs
index e9cb00a..5e802b4 100644
--- a/src/bin/subplot.rs
+++ b/src/bin/subplot.rs
@@ -504,13 +504,6 @@ fn load_linted_doc(
Ok(doc)
}
-fn print_source_errors(e: Option<&dyn std::error::Error>) {
- if let Some(e) = e {
- error!("{}", e);
- print_source_errors(e.source());
- }
-}
-
fn real_main() {
info!("Starting Subplot");
let argparser = Toplevel::command();
@@ -525,7 +518,11 @@ fn real_main() {
}
Err(e) => {
error!("{}", e);
- print_source_errors(e.source());
+ let mut e = e.source();
+ while let Some(source) = e {
+ error!("caused by: {}", source);
+ e = source.source();
+ }
process::exit(1);
}
}