From e5f5febd6b0029759aa278a1c56a2e91b13d581b Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 24 Nov 2019 20:39:57 +0200 Subject: [PATCH] Log notification script failures --- ui/src/components/notifications.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/src/components/notifications.rs b/ui/src/components/notifications.rs index 1293a768..8e603662 100644 --- a/ui/src/components/notifications.rs +++ b/ui/src/components/notifications.rs @@ -145,14 +145,21 @@ impl Component for NotificationFilter { fn process_event(&mut self, event: &mut UIEvent, context: &mut Context) -> bool { if let UIEvent::Notification(ref title, ref body, ref kind) = event { if let Some(ref bin) = context.runtime_settings.notifications.script { - if let Err(v) = Command::new(bin) - .arg(title.as_ref().map(String::as_str).unwrap_or("Event")) + if let Err(err) = Command::new(bin) + .arg(title.as_ref().map(String::as_str).unwrap_or("meli")) .arg(body) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .spawn() { - debug!("{:?}", v); + log( + format!( + "Could not run notification script: {}.", + err.to_string() + ), + ERROR, + ); + debug!("{:?}", err); } }