Fix: Ignore Broken Pipe errors when writing list
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
49eb0c13e9
commit
82146e0c98
1 changed files with 9 additions and 1 deletions
|
@ -326,7 +326,15 @@ fn list_todos(rt: &Runtime, matcher: &StatusMatcher, show_hidden: bool) -> Resul
|
||||||
})
|
})
|
||||||
.and_then_ok(|entry| {
|
.and_then_ok(|entry| {
|
||||||
if !rt.output_is_pipe() && (show_hidden || filter_hidden.filter(&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)
|
rt.report_touched(entry.get_location()).map_err(Error::from)
|
||||||
|
|
Loading…
Reference in a new issue