Browse Source

Log notification script failures

jmap
Manos Pitsidianakis 2 years ago
parent
commit
e5f5febd6b
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 13
      ui/src/components/notifications.rs

13
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);
}
}

Loading…
Cancel
Save