pub enum Error {
Show 18 variants
Connect {
socket: String,
source: Error,
},
RequestTimeout {
method: String,
path: String,
timeout: Duration,
},
Api {
method: String,
path: String,
status: u16,
message: String,
},
OperationTimeout {
step: String,
operation: String,
status: String,
waited: Duration,
cancelled: bool,
},
OperationFailed {
step: String,
message: String,
},
NotReady {
sandbox: String,
check: String,
detail: String,
waited: Duration,
},
ExecTimeout {
argv: String,
timeout: Duration,
},
NotFound(String),
AlreadyExists(String),
Invalid(String),
Forbidden(String),
Interpolation(String),
Parse {
path: String,
message: String,
},
WebSocket(String),
Protocol(String),
Remote {
code: String,
message: String,
data: Value,
},
Io(Error),
Json(Error),
}Expand description
Everything isb can fail with.
Variants§
Connect
Could not reach incusd at all (socket missing, permission denied, refused).
RequestTimeout
A single HTTP request to incusd did not complete within its socket timeout.
Api
incusd answered with an error response.
OperationTimeout
A background operation ran past its deadline. step names what isb was
doing (“create instance”, “start instance”, …), so a stall is reported
as the step that stalled rather than as a bare hang.
OperationFailed
A background operation finished unsuccessfully.
NotReady
A readiness check did not pass before its deadline.
ExecTimeout
An exec with an explicit timeout ran past it; the process was sent SIGKILL.
NotFound(String)
AlreadyExists(String)
Invalid(String)
The spec, the compose file or an argument is invalid.
Forbidden(String)
The caller may not do this (another org’s resources, a platform-only tool, or no isb account).
Interpolation(String)
Variable interpolation failed (unset variable, ${VAR:?message}, bad syntax).
Parse
WebSocket(String)
Protocol(String)
Remote
A tool called through isb serve failed. code and data are the
fields of the server-side error’s crate::rpc::error_json.
Io(Error)
Json(Error)
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
True for an incusd “not found” answer.
Sourcepub fn is_conflict(&self) -> bool
pub fn is_conflict(&self) -> bool
True for an incusd conflict (the object already exists).
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
True when the error is a deadline, either on a request or an operation.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()