Skip to main content

ComputerError

Enum ComputerError 

Source
pub enum ComputerError {
Show 25 variants NotFound(String), AlreadyExists(String), WrongState { id: String, expected: String, actual: String, }, Paused(String), Io(Error), Json(Error), Driver(Error), Network(String), Snapshot(String), DeviceMapper(String), Rootfs(String), Process(String), Config(String), Vsock(String), PathNotFound(String), NotADirectory(String), DirectoryNotEmpty(String), TemplateNotFound(String), TemplateVersionExists(String), FailedPrecondition(String), DeadlineExceeded(String), Unavailable(String), AckUnconfirmed { id: String, detail: String, }, StdinGap { accepted: u64, offset: u64, }, Other(String),
}
Expand description

Computer runtime error type.

Variants§

§

NotFound(String)

The requested VM was not found.

§

AlreadyExists(String)

A VM with the given name already exists.

§

WrongState

The VM is not in a state that allows the requested operation.

Fields

§expected: String
§actual: String
§

Paused(String)

The sandbox is paused. Distinct from Self::WrongState so callers (the daemon’s transparent auto-resume, CORE-21) can recognise “paused” machine-readably instead of parsing state strings.

§

Io(Error)

I/O error (file system, sockets, etc.).

§

Json(Error)

JSON serialisation/deserialisation error.

§

Driver(Error)

The VM driver — the port’s adapter, or a capability reached through it — failed in a way that has no native shape here (an adapter fault, a foreign checkpoint). The port’s NotFound, WrongState, Io, Network and InvalidSpec land on their native variants instead (see the From impl), so the guest agent’s wire mapping keeps answering 404 / 412 for them rather than 500.

§

Network(String)

Network-related error (TAP creation, IP allocation, etc.).

§

Snapshot(String)

Snapshot catalog error.

§

DeviceMapper(String)

Device-mapper / dm-snapshot error.

§

Rootfs(String)

Building a sandbox rootfs image (OCI/overlay2 → ext4, vm-agent injection, the default busybox image) failed.

§

Process(String)

Process lifecycle error.

§

Config(String)

Configuration error.

§

Vsock(String)

Vsock / guest-agent communication error.

§

PathNotFound(String)

A path inside a sandbox does not exist. The message shape is a contract: the daemon’s error classifier keys on the “path not found:” prefix to attach the FILE_NOT_FOUND registry code.

§

NotADirectory(String)

A directory operation addressed a non-directory path.

§

DirectoryNotEmpty(String)

Refused to remove a non-empty directory without recursive (FAILED_PRECONDITION per the filesystem contract).

§

TemplateNotFound(String)

A catalog template reference did not resolve. The message shape is a contract: the daemon’s classifier keys on the “template not found:” prefix to attach the TEMPLATE_NOT_FOUND registry code (CORE-107).

§

TemplateVersionExists(String)

Publishing would repoint an existing immutable template version at different content (409 on the daemon surface).

§

FailedPrecondition(String)

A required precondition does not hold and retrying the same request never helps (FAILED_PRECONDITION on the daemon surface).

§

DeadlineExceeded(String)

A bounded wait elapsed before the awaited condition held (DEADLINE_EXCEEDED on the daemon surface).

§

Unavailable(String)

A retryable operation whose durable result could not be confirmed.

§

AckUnconfirmed

The operation’s side effects committed — the sandbox exists and is running — but the acknowledging record’s durability is unconfirmed. Distinct from ComputerError::Unavailable so callers with a fallback (warm create) can tell “nothing happened, retry freely” from “it happened, do NOT re-execute”.

Fields

§id: String

The sandbox whose operation committed.

§detail: String

The underlying durability failure.

§

StdinGap

A stdin write starts past the accepted byte count — the caller must resume from accepted (its offsets have a gap).

Fields

§accepted: u64

Bytes accepted so far — the offset the next write must start at.

§offset: u64

The rejected write’s offset.

§

Other(String)

Generic catch-all error.

Trait Implementations§

Source§

impl Debug for ComputerError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ComputerError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ComputerError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AtomicWriteError> for ComputerError

A durable write that never landed is an I/O failure; one that landed without a confirmed rename is ComputerError::Unavailable — the caller may retry, and the retry is safe because the write is idempotent.

Callers that can do better than this (the sandbox record store keeps the record and warns) match on [AtomicWriteError] themselves instead of going through here.

Source§

fn from(err: AtomicWriteError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ComputerError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ComputerError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ComputerError

Variant-for-variant where a native shape exists, so a driver-reported NotFound or WrongState keeps the wire code the equivalent native error already has (the guest agent classifies ComputerError by variant; anything it does not know becomes a 500), and so do the guest network’s two protocol answers — retry-later and failed precondition, the 503 and 412 of the cleanup-token protocol. What has no native shape — an adapter fault, a checkpoint another driver wrote — stays ComputerError::Driver with the port error intact for its source chain.

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<SnapshotError> for ComputerError

Variant-for-variant, so a snapshot or template failure keeps the exact shape callers already match on — the daemon maps TemplateNotFound and TemplateVersionExists onto their own wire codes, and folding either into a generic error would change the surface.

Source§

fn from(err: SnapshotError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more