opencode_cloud_core/host/
error.rs1use thiserror::Error;
6
7#[derive(Error, Debug)]
9pub enum HostError {
10 #[error("Failed to spawn SSH: {0}")]
12 SshSpawn(String),
13
14 #[error("SSH connection failed: {0}")]
16 ConnectionFailed(String),
17
18 #[error("SSH authentication failed. Ensure your key is loaded: ssh-add {}", .key_hint.as_deref().unwrap_or("~/.ssh/id_rsa"))]
20 AuthFailed { key_hint: Option<String> },
21
22 #[error("Host not found: {0}")]
24 NotFound(String),
25
26 #[error("Host already exists: {0}")]
28 AlreadyExists(String),
29
30 #[error("Failed to allocate local port: {0}")]
32 PortAllocation(String),
33
34 #[error("Failed to load hosts file: {0}")]
36 LoadFailed(String),
37
38 #[error("Failed to save hosts file: {0}")]
40 SaveFailed(String),
41
42 #[error("Invalid host configuration: {0}")]
44 InvalidConfig(String),
45
46 #[error("SSH tunnel connection timed out after {0} attempts")]
48 TunnelTimeout(u32),
49
50 #[error("Docker not available on remote host: {0}")]
52 RemoteDockerUnavailable(String),
53
54 #[error("Failed to read SSH config: {0}")]
56 SshConfigRead(String),
57
58 #[error("Failed to write SSH config: {0}")]
60 SshConfigWrite(String),
61}