fix(notification): fail silently when notification system unavailable
Systems without a notification daemon (e.g., minimal Linux setups) would crash when the app tried to show notifications. Now we log a warning and continue instead of propagating the error. Fixes #32
This commit is contained in:
1 parent
90e4216826
commit
4548845fbf
1 file changed
+10
-6
@@ -158,9 +158,11 @@ pub fn show_track_notification(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
notification
|
// Show notification, but don't fail if notification system is unavailable
|
||||||
.show()
|
// This handles systems without a notification daemon (issue #32)
|
||||||
.map_err(|e| format!("Failed to show notification: {}", e))?;
|
if let Err(e) = notification.show() {
|
||||||
|
log::warn!("Could not show notification (notification system may be unavailable): {}", e);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -180,9 +182,11 @@ pub fn show_notification(
|
|||||||
notification.body(&body_text);
|
notification.body(&body_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
notification
|
// Show notification, but don't fail if notification system is unavailable
|
||||||
.show()
|
// This handles systems without a notification daemon (issue #32)
|
||||||
.map_err(|e| format!("Failed to show notification: {}", e))?;
|
if let Err(e) = notification.show() {
|
||||||
|
log::warn!("Could not show notification (notification system may be unavailable): {}", e);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user