mirror of
https://github.com/NotAShelf/stash.git
synced 2026-06-18 02:33:56 +00:00
clipboard: downgrade error logging to debug for expected failures
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ic1cca0d0212b9b3611da8ca3f9c6fb326a6a6964
This commit is contained in:
parent
4055adb896
commit
cf207d0a3d
3 changed files with 11 additions and 10 deletions
|
|
@ -456,6 +456,9 @@ fn handle_regular_paste(
|
|||
bail!("no content available and --no-newline specified");
|
||||
}
|
||||
if let Err(e) = out.write_all(&buf) {
|
||||
if e.kind() == io::ErrorKind::BrokenPipe {
|
||||
return Ok(());
|
||||
}
|
||||
bail!("failed to write to stdout: {e}");
|
||||
}
|
||||
|
||||
|
|
@ -471,12 +474,12 @@ fn handle_regular_paste(
|
|||
|| types == "application/x-sh"
|
||||
};
|
||||
|
||||
if !args.no_newline
|
||||
&& is_text_content
|
||||
&& !buf.ends_with(b"\n")
|
||||
&& let Err(e) = out.write_all(b"\n")
|
||||
{
|
||||
bail!("failed to write newline to stdout: {e}");
|
||||
if !args.no_newline && is_text_content && !buf.ends_with(b"\n") {
|
||||
if let Err(e) = out.write_all(b"\n") {
|
||||
if e.kind() != io::ErrorKind::BrokenPipe {
|
||||
bail!("failed to write newline to stdout: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(PasteError::NoSeats) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue