clipboard: downgrade error logging to debug for expected failures

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ic1cca0d0212b9b3611da8ca3f9c6fb326a6a6964
This commit is contained in:
raf 2026-05-03 17:19:24 +03:00
commit cf207d0a3d
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 11 additions and 10 deletions

View file

@ -196,8 +196,7 @@ fn serve_clipboard_child(prepared: PreparedCopy) {
},
Err(e) => {
log::error!("clipboard persistence: serve failed: {e}");
exit(1);
log::debug!("clipboard persistence: serve ended: {e}");
},
}
}

View file

@ -222,8 +222,7 @@ fn fork_and_serve(prepared_copy: wl_clipboard_rs::copy::PreparedCopy) {
0 => {
// Child process - serve clipboard content
if let Err(e) = prepared_copy.serve() {
log::error!("background clipboard service failed: {e}");
std::process::exit(1);
log::debug!("background clipboard service ended: {e}");
}
std::process::exit(0);
},

View file

@ -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) => {