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");
|
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);
|
||||||
|
|
Loading…
Reference in a new issue