Fix imag-diary to ignore broken pipes
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
a157b23258
commit
bb4f0ace6b
1 changed files with 10 additions and 2 deletions
|
@ -23,9 +23,11 @@ use libimagrt::runtime::Runtime;
|
||||||
use libimagerror::trace::MapErrTrace;
|
use libimagerror::trace::MapErrTrace;
|
||||||
use libimagerror::iter::TraceIterator;
|
use libimagerror::iter::TraceIterator;
|
||||||
use libimagerror::exit::ExitUnwrap;
|
use libimagerror::exit::ExitUnwrap;
|
||||||
|
use libimagerror::io::ToExitCode;
|
||||||
use libimagutil::warn_exit::warn_exit;
|
use libimagutil::warn_exit::warn_exit;
|
||||||
use libimagstore::iter::get::StoreIdGetIteratorExtension;
|
use libimagstore::iter::get::StoreIdGetIteratorExtension;
|
||||||
use libimagentryview::viewer::Viewer;
|
use libimagentryview::viewer::Viewer;
|
||||||
|
use libimagentryview::error::Error;
|
||||||
|
|
||||||
use crate::util::get_diary_name;
|
use crate::util::get_diary_name;
|
||||||
|
|
||||||
|
@ -49,7 +51,13 @@ pub fn view(rt: &Runtime) {
|
||||||
});
|
});
|
||||||
|
|
||||||
let out = rt.stdout();
|
let out = rt.stdout();
|
||||||
DV::new(hdr).view_entries(entries, &mut out.lock())
|
let mut outlock = out.lock();
|
||||||
.map_err_trace_exit_unwrap();
|
|
||||||
|
if let Err(e) = DV::new(hdr).view_entries(entries, &mut outlock) {
|
||||||
|
match e {
|
||||||
|
Error::Io(e) => Err(e).to_exit_code().unwrap_or_exit(),
|
||||||
|
Error::Other(e) => Err(e).map_err_trace_exit_unwrap()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue