refactor(app): better error handling
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -45,6 +45,12 @@ fn main() {
|
||||
Box::new(system_monitor_adapter),
|
||||
Box::new(formatter),
|
||||
);
|
||||
service.alert_on_threshold_violation();
|
||||
service.send_all_metrics_notification();
|
||||
|
||||
if let Err(e) = service.alert_on_threshold_violation() {
|
||||
eprintln!("Error during threshold violation check: {}", e);
|
||||
}
|
||||
|
||||
if let Err(e) = service.send_all_metrics_notification() {
|
||||
eprintln!("Error sending final notification: {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user