summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-11-23 19:59:34 +0100
committerMatthias Beyer <mail@beyermatthias.de>2019-12-01 14:44:33 +0100
commit82146e0c98d4fa7d32b92d88d21554fa0ab93174 (patch)
treeaf9eab3f19ac8df6dcf4ee68aa076413c96861b9
parent49eb0c13e9664ae7af5ead8bb3f6b825a5e140d9 (diff)
Fix: Ignore Broken Pipe errors when writing list
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--bin/domain/imag-todo/src/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/domain/imag-todo/src/lib.rs b/bin/domain/imag-todo/src/lib.rs
index 88046d96..aa163dff 100644
--- a/bin/domain/imag-todo/src/lib.rs
+++ b/bin/domain/imag-todo/src/lib.rs
@@ -326,7 +326,15 @@ fn list_todos(rt: &Runtime, matcher: &StatusMatcher, show_hidden: bool) -> Resul
})
.and_then_ok(|entry| {
if !rt.output_is_pipe() && (show_hidden || filter_hidden.filter(&entry)?) {
- viewer.view_entry(&entry, &mut rt.stdout())?;
+ if let Err(e) = viewer.view_entry(&entry, &mut rt.stdout()) {
+ use libimagentryview::error::Error;
+ match e {
+ Error::Other(e) => return Err(e),
+ Error::Io(e) => if e.kind() != std::io::ErrorKind::BrokenPipe {
+ return Err(failure::Error::from(e))
+ },
+ }
+ }
}
rt.report_touched(entry.get_location()).map_err(Error::from)