1#[derive(Debug, thiserror::Error)]
3pub enum DroidrunError {
4 #[error("ADB error: {0}")]
5 Adb(#[from] droidrun_adb::AdbError),
6
7 #[error("HTTP error: {0}")]
8 Http(#[from] reqwest::Error),
9
10 #[error("JSON error: {0}")]
11 Json(#[from] serde_json::Error),
12
13 #[error("I/O error: {0}")]
14 Io(#[from] std::io::Error),
15
16 #[error("Device not connected")]
17 NotConnected,
18
19 #[error("Portal not installed on device")]
20 PortalNotInstalled,
21
22 #[error("Portal accessibility service not enabled")]
23 PortalAccessibilityDisabled,
24
25 #[error("Portal setup failed: {0}")]
26 PortalSetupFailed(String),
27
28 #[error("Portal communication error: {0}")]
29 PortalCommError(String),
30
31 #[error("Element not found: index {0}")]
32 ElementNotFound(usize),
33
34 #[error("Element {0} has no bounds")]
35 ElementNoBounds(usize),
36
37 #[error("Element {0} is fully obscured")]
38 ElementObscured(usize),
39
40 #[error("Invalid bounds format: {0}")]
41 InvalidBounds(String),
42
43 #[error("Screen dimensions not available")]
44 NoDimensions,
45
46 #[error("Parse error: {0}")]
47 Parse(String),
48
49 #[error("Not supported: {0}")]
50 NotSupported(String),
51
52 #[error("Timeout: {0}")]
53 Timeout(String),
54}
55
56pub type Result<T> = std::result::Result<T, DroidrunError>;