Fix: Do not call exit(), but propagate error

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2019-11-10 01:53:09 +01:00
parent 99fedd5abd
commit 9f5b28ea11

View file

@ -134,10 +134,8 @@ pub fn kairos_parse(spec: &str) -> Result<NaiveDateTime> {
trace!("before-filter spec resulted in timetype"); trace!("before-filter spec resulted in timetype");
let tt = tt.calculate() let tt = tt.calculate()
.map_err_trace_exit_unwrap() .map_err_trace_exit_unwrap()
.get_moment().unwrap_or_else(|| { .get_moment()
error!("Not a moment in time: {}", spec); .ok_or_else(|| format_err!("Not a moment in time: {}", spec))?
::std::process::exit(1);
})
.clone(); .clone();
trace!("Before filter spec {} => {}", spec, tt); trace!("Before filter spec {} => {}", spec, tt);