Fix: Do not call exit(), but propagate error
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
99fedd5abd
commit
9f5b28ea11
1 changed files with 2 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue