atomr_agents_coding_cli_isolator/
error.rs1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum IsolatorError {
5 #[error("spawn failed: {0}")]
6 Spawn(String),
7
8 #[error("io error: {0}")]
9 Io(#[from] std::io::Error),
10
11 #[error("pty error: {0}")]
12 Pty(String),
13
14 #[error("process already exited")]
15 AlreadyExited,
16
17 #[cfg(feature = "docker")]
18 #[error("docker error: {0}")]
19 Docker(String),
20
21 #[error("not supported in this isolator: {0}")]
22 Unsupported(&'static str),
23}
24
25#[cfg(feature = "docker")]
26impl From<bollard::errors::Error> for IsolatorError {
27 fn from(e: bollard::errors::Error) -> Self {
28 IsolatorError::Docker(e.to_string())
29 }
30}