aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-03-30 11:25:53 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-03-30 15:25:56 +0200
commit0362df3a4a5d91cb2b8e530d44de327da7a18765 (patch)
tree2f5b7be196813121af6c1a48322f3937dba8854c /mumd/src
parente1907114374c842654f86b234b816f57dbbc79d4 (diff)
downloadmum-0362df3a4a5d91cb2b8e530d44de327da7a18765.tar.gz
warn if notification init fails
Diffstat (limited to 'mumd/src')
-rw-r--r--mumd/src/notify.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/mumd/src/notify.rs b/mumd/src/notify.rs
index 66a0faf..e52b909 100644
--- a/mumd/src/notify.rs
+++ b/mumd/src/notify.rs
@@ -1,6 +1,10 @@
+use log::*;
+
pub fn init() {
#[cfg(feature = "notifications")]
- libnotify::init("mumd").unwrap(); //TODO handle panic (don't send notifications)
+ if libnotify::init("mumd").is_err() {
+ warn!("Unable to initialize notifications");
+ }
}
#[cfg(feature = "notifications")]
@@ -8,7 +12,7 @@ pub fn send(msg: String) -> Option<bool> {
match libnotify::Notification::new("mumd", Some(msg.as_str()), None).show() {
Ok(_) => Some(true),
Err(_) => {
- log::debug!("Unable to send notification");
+ warn!("Unable to send notification");
Some(false)
}
}