summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-11-10 01:53:09 +0100
committerMatthias Beyer <mail@beyermatthias.de>2019-11-10 01:53:09 +0100
commit9f5b28ea111249a6bb00e1b188e8b0d6a5aa0572 (patch)
treec6b01d87a66b257eda5bb31b033a461aa8fbbea7
parent99fedd5abd77dd5ea8da5806667fe53680acc879 (diff)
Fix: Do not call exit(), but propagate error
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--bin/domain/imag-calendar/src/util.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/bin/domain/imag-calendar/src/util.rs b/bin/domain/imag-calendar/src/util.rs
index e51b0a0..a3f1735 100644
--- a/bin/domain/imag-calendar/src/util.rs
+++ b/bin/domain/imag-calendar/src/util.rs
@@ -134,10 +134,8 @@ pub fn kairos_parse(spec: &str) -> Result<NaiveDateTime> {
trace!("before-filter spec resulted in timetype");
let tt = tt.calculate()
.map_err_trace_exit_unwrap()
- .get_moment().unwrap_or_else(|| {
- error!("Not a moment in time: {}", spec);
- ::std::process::exit(1);
- })
+ .get_moment()
+ .ok_or_else(|| format_err!("Not a moment in time: {}", spec))?
.clone();
trace!("Before filter spec {} => {}", spec, tt);