feat: resort to printing error if sending notification fails
This commit is contained in:
parent
a841321638
commit
65f389c81e
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue