feat: resort to printing error if sending notification fails

This commit is contained in:
trafficlunar 2025-07-22 14:23:10 +01:00
parent a841321638
commit 65f389c81e

View file

@ -3,11 +3,13 @@ use std::time::Duration;
use notify_rust::Notification; use notify_rust::Notification;
pub fn send_error_notification(body: &str) { pub fn send_error_notification(body: &str) {
Notification::new() if let Err(e) = Notification::new()
.summary("Computer Statistics Error") .summary("Computer Statistics Error")
.body(body) .body(body)
.icon("dialog-error") .icon("dialog-error")
.timeout(Duration::from_millis(60000)) .timeout(Duration::from_millis(60000))
.show() .show()
.unwrap(); {
eprintln!("Failed to send error notification: {}", e);
}
} }