audb_core/tools/
errors.rs1use thiserror::Error;
6
7#[derive(Error, Debug)]
9pub enum DeviceError {
10 #[error("Device not found: {0}")]
12 NotFound(String),
13
14 #[error("Root password not configured for device: {0}")]
16 RootPasswordNotConfigured(String),
17
18 #[error("Connection failed: {0}")]
20 ConnectionFailed(String),
21
22 #[error("SSH error: {0}")]
24 SshError(#[from] anyhow::Error),
25
26 #[error("Device validation failed: {0}")]
28 ValidationError(String),
29}
30
31#[derive(Error, Debug)]
33pub enum ConfigError {
34 #[error("Failed to read config: {0}")]
36 ReadError(#[from] std::io::Error),
37
38 #[error("Invalid config format: {0}")]
40 ParseError(#[from] serde_json::Error),
41
42 #[error("Config validation failed: {0}")]
44 ValidationError(String),
45
46 #[error("Config file not found at: {0}")]
48 NotFound(String),
49}
50
51#[derive(Error, Debug)]
53pub enum InputError {
54 #[error("Invalid coordinates: {0}")]
56 InvalidCoordinates(String),
57
58 #[error("Script execution failed: {0}")]
60 ScriptExecutionFailed(String),
61
62 #[error("D-Bus command failed: {0}")]
64 DbusCommandFailed(String),
65
66 #[error(transparent)]
68 DeviceError(#[from] DeviceError),
69}
70
71#[derive(Error, Debug)]
73pub enum InstallError {
74 #[error("Invalid RPM file: {0}")]
76 InvalidRpmFile(String),
77
78 #[error("Package installation failed: {0}")]
80 InstallationFailed(String),
81
82 #[error(transparent)]
84 DeviceError(#[from] DeviceError),
85}