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()
|
||||
.map_err(|e| format!("Failed to show notification: {}", e))?;
|
||||
// Show notification, but don't fail if notification system is unavailable
|
||||
// This handles systems without a notification daemon (issue #32)
|
||||
if let Err(e) = notification.show() {
|
||||
log::warn!("Could not show notification (notification system may be unavailable): {}", e);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -180,9 +182,11 @@ pub fn show_notification(
|
||||
notification.body(&body_text);
|
||||
}
|
||||
|
||||
notification
|
||||
.show()
|
||||
.map_err(|e| format!("Failed to show notification: {}", e))?;
|
||||
// Show notification, but don't fail if notification system is unavailable
|
||||
// This handles systems without a notification daemon (issue #32)
|
||||
if let Err(e) = notification.show() {
|
||||
log::warn!("Could not show notification (notification system may be unavailable): {}", e);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user