Log notification script failures
parent
db197aaffe
commit
e5f5febd6b
|
@ -145,14 +145,21 @@ impl Component for NotificationFilter {
|
||||||
fn process_event(&mut self, event: &mut UIEvent, context: &mut Context) -> bool {
|
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 UIEvent::Notification(ref title, ref body, ref kind) = event {
|
||||||
if let Some(ref bin) = context.runtime_settings.notifications.script {
|
if let Some(ref bin) = context.runtime_settings.notifications.script {
|
||||||
if let Err(v) = Command::new(bin)
|
if let Err(err) = Command::new(bin)
|
||||||
.arg(title.as_ref().map(String::as_str).unwrap_or("Event"))
|
.arg(title.as_ref().map(String::as_str).unwrap_or("meli"))
|
||||||
.arg(body)
|
.arg(body)
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
.spawn()
|
.spawn()
|
||||||
{
|
{
|
||||||
debug!("{:?}", v);
|
log(
|
||||||
|
format!(
|
||||||
|
"Could not run notification script: {}.",
|
||||||
|
err.to_string()
|
||||||
|
),
|
||||||
|
ERROR,
|
||||||
|
);
|
||||||
|
debug!("{:?}", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue