#[non_exhaustive]pub enum Error {
Show 13 variants
InvalidRequest {
reason: String,
},
Authentication {
reason: String,
},
NotFound {
reason: String,
},
Conflict {
reason: String,
},
Refused {
status: u16,
reason: String,
},
SandboxEnded {
sandbox: SandboxId,
state: RunState,
},
SandboxFailed {
sandbox: SandboxId,
reason: String,
},
CommandRefused {
number: CommandNumber,
reason: String,
},
ReplayEnded {
replay: RunId,
state: RunState,
},
NoApiKey {
api_url: String,
},
Credentials {
path: PathBuf,
problem: String,
},
Network {
context: String,
source: Option<Error>,
},
Unexpected(String),
}Expand description
What the SDK returns when a call fails. A command’s exit code is never one of these.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidRequest
400: the request isn’t one dvm.run takes, such as an image that isn’t one.
Authentication
401: the API key was revoked, or isn’t one.
NotFound
404: no such sandbox, command, execution or replay, or not the key’s user’s.
Conflict
409: what was asked can’t be done in the state it’s in.
Refused
Another refusal: its status, and dvm.run’s reason.
SandboxEnded
The sandbox ended (stopped, or its command exited) before the call could act on it.
SandboxFailed
dvm or the platform ended the sandbox, and why: a syscall dvm can’t serve, a limit, its runner going away.
CommandRefused
The sandbox didn’t take the command, and why: a script in an image with no shell, a command too long.
ReplayEnded
A replay ended without a verdict: dvm saw it part from its execution and failed it, with where, or it was stopped.
NoApiKey
No key was given, in DVM_API_KEY, or saved by dvm-run login.
Credentials
The saved keys couldn’t be read or written.
Network
dvm.run couldn’t be reached, or the connection to it dropped.
Unexpected(String)
dvm.run answered what the SDK can’t read.
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()