From d8b1ac1f37163d97fd8f5a03d9377a111382770c Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 9 Oct 2025 11:29:34 +0300 Subject: [PATCH] list: properly error notification if clipboard copy fails Signed-off-by: NotAShelf Change-Id: I6a6a696459d7fbc344545daeead6164cad5cde6f --- src/commands/list.rs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/commands/list.rs b/src/commands/list.rs index c35d870..c20b0a0 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -296,13 +296,22 @@ impl SqliteClipboardDb { Some(ref m) => MimeType::Specific(m.clone()), None => MimeType::Text, }; - let _ = opts + let copy_result = opts .copy(Source::Bytes(contents.clone().into()), mime_type); - // Show notification - let _ = Notification::new() - .summary("Stash") - .body("Copied entry to clipboard") - .show(); + match copy_result { + Ok(()) => { + let _ = Notification::new() + .summary("Stash") + .body("Copied entry to clipboard") + .show(); + }, + Err(e) => { + let _ = Notification::new() + .summary("Stash") + .body(&format!("Failed to copy entry: {e}")) + .show(); + }, + } } } },