mirror of
https://github.com/NotAShelf/stash.git
synced 2026-05-07 07:55:24 +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
|
|
@ -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}");
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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