Skip to main content

ErrorCode

Enum ErrorCode 

Source
#[non_exhaustive]
pub enum ErrorCode {
Show 33 variants ManifestInvalid, ManifestVersion, Unsupported, Io, Locked, ToolMissing, ToolFailed, ToolTooOld, Timeout, DownloadStalled, DownloadFailed, AlreadyRunning, RunningElsewhere, PortInUse, NotParkable, NothingToResume, NotRunning, NotReady, SecretMissing, ParamInvalid, RunName, ProviderRefused, ElevationFailed, MachineUnknown, MachineAmbiguous, NetworkUnknown, SlotsFull, AdoptRefused, Unreachable, NotSealed, Cancelled, Usage, NoConsole,
}
Expand description

The stable code of a failure, the same in the Rust API and the event stream (error.code).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ManifestInvalid

The manifest isn’t valid JSON or breaks the contract, a value it gives can’t be used as written (a step’s verdict that isn’t a regular expression, an SSH login, a wait_s, a tcp condition’s port), or it names a value the operation doesn’t have (a placeholder with none, a guest delivery’s machine whose address no output gives, a Terraform module with no .tf file).

§

ManifestVersion

The manifest is another version of the contract.

§

Unsupported

The manifest needs something this runner doesn’t do (a target that doesn’t run on this host, a delivery its driver doesn’t take, an action of another driver’s, a step with no command for this host), or the call asks the run for something its target can’t do (a console into a Compose service with no VM, a Vagrant VM joined to another network).

§

Io

A file or folder couldn’t be read or written, or a socket on this computer bound.

§

Locked

Another process runs an operation on this run, or holds the home’s slot pick.

§

ToolMissing

A tool a step runs isn’t installed.

§

ToolFailed

A step’s tool ran and failed.

§

ToolTooOld

A tool answers at a version older than the run needs.

§

Timeout

A step showed no progress for its time limit, or ran to the ceiling every step stops at, and was stopped, with what it started (the error event’s timeout says which).

§

DownloadStalled

A download (what a step needs, fetched in a phase of its own before it: a Compose start’s images, a Vagrant start’s boxes; or a step the manifest marks a download) showed no progress for as long as a download may, and was stopped.

§

DownloadFailed

A download couldn’t be made: its tool failed (the message says why: a registry or a box catalog refusing it, a name it doesn’t know, the network).

§

AlreadyRunning

The run is already up.

§

RunningElsewhere

The run is recorded on another place (server or account) than the one asked for.

§

PortInUse

A host port the run publishes is taken.

§

NotParkable

The manifest has no park steps for that mode.

§

NothingToResume

Nothing of the run, or not every one of its machines, is left to resume.

§

NotRunning

The run isn’t up.

§

NotReady

A ready condition didn’t hold.

§

SecretMissing

A required secret or input has no value.

§

ParamInvalid

A param is unknown, missing or holds a value it doesn’t allow.

§

RunName

A run name that can’t name a run.

§

ProviderRefused

The run’s Vagrant provider is missing, unknown, not on this host, refused by the run, or lacks its plugin.

§

ElevationFailed

The elevation Hyper-V’s commands need couldn’t be had or was lost: the permission prompt declined or unanswered, the elevated session not started or ended before the operation (the message says which).

§

MachineUnknown

A machine the run doesn’t have.

§

MachineAmbiguous

The run has several machines the call could mean, and it named none.

§

NetworkUnknown

A network the run doesn’t have.

§

SlotsFull

Every slot of the place is held by another run.

§

AdoptRefused

A deployment can’t be taken over as a run.

§

Unreachable

A machine a step goes to over SSH never answered.

§

NotSealed

The run’s seal failed: it is up, but not sealed, so not ready.

§

Cancelled

The operation was cut short before it ended (its future dropped: an embedder’s cancel, the command line’s Ctrl-C or SIGTERM); the tools it started were asked to stop, and are ended once they have, or 30 seconds later.

§

Usage

The embedder was asked for something that makes no sense (the command line: a run folder with no manifest, a value missing or malformed), so no operation started.

§

NoConsole

The machine has no graphical console to reach: its target or provider gives none (the error says why), it isn’t running, or its hypervisor doesn’t say where it is.

Implementations§

Source§

impl ErrorCode

Source

pub fn as_str(self) -> &'static str

The code as written in JSON (port_in_use).

Trait Implementations§

Source§

impl Clone for ErrorCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ErrorCode

Source§

impl Debug for ErrorCode

Source§

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

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

impl<'de> Deserialize<'de> for ErrorCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ErrorCode

Source§

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

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

impl Eq for ErrorCode

Source§

impl Hash for ErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl JsonSchema for ErrorCode

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for ErrorCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ErrorCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ErrorCode

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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