File tree Expand file tree Collapse file tree 3 files changed +10
-12
lines changed
crates/core/tedge_watchdog/src Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 1
1
use std:: path:: PathBuf ;
2
2
3
3
pub async fn start_watchdog ( _config_dir : PathBuf ) -> Result < ( ) , anyhow:: Error > {
4
- Err ( anyhow:: Error :: from (
5
- crate :: error:: WatchdogError :: WatchdogNotAvailable ,
6
- ) )
4
+ Err ( anyhow:: Error :: from ( WatchdogError :: WatchdogNotAvailable ) )
5
+ }
6
+
7
+ #[ derive( Debug , thiserror:: Error ) ]
8
+ pub enum WatchdogError {
9
+ #[ error( "The watchdog is not available on this platform" ) ]
10
+ WatchdogNotAvailable ,
7
11
}
Original file line number Diff line number Diff line change 1
- use time:: error:: Parse ;
2
-
3
1
use mqtt_channel:: MqttError ;
4
-
5
2
use tedge_config:: CertificateError ;
6
3
use tedge_config:: ConfigSettingError ;
7
4
use tedge_config:: TEdgeConfigError ;
5
+ use time:: error:: Parse ;
8
6
9
7
#[ derive( Debug , thiserror:: Error ) ]
10
8
pub enum WatchdogError {
11
- #[ cfg( not( target_os = "linux" ) ) ]
12
- #[ error( "The watchdog is not available on this platform" ) ]
13
- WatchdogNotAvailable ,
14
-
15
9
#[ error( "MQTT receiver closed" ) ]
16
10
ChannelClosed ,
17
11
Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ use std::path::PathBuf;
2
2
use tedge_config:: system_services:: * ;
3
3
use tedge_config:: DEFAULT_TEDGE_CONFIG_PATH ;
4
4
5
- mod error;
6
-
7
5
// on linux, we use systemd
8
6
#[ cfg( target_os = "linux" ) ]
9
7
mod systemd_watchdog;
10
8
#[ cfg( target_os = "linux" ) ]
11
9
use systemd_watchdog as watchdog;
10
+ #[ cfg( target_os = "linux" ) ]
11
+ mod error;
12
12
13
13
// on non-linux, we do nothing for now
14
14
#[ cfg( not( target_os = "linux" ) ) ]
You can’t perform that action at this time.
0 commit comments