Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 31 variants RepositoryNotFound { start: PathBuf, }, LegacyLayout { root: PathBuf, }, InvalidManifest { path: PathBuf, reason: String, }, UnsupportedSchema { path: PathBuf, found: String, supported: String, }, InvalidSources { path: PathBuf, reason: String, }, InvalidScope { path: PathBuf, reason: String, }, UnknownKeys { path: PathBuf, keys: Vec<String>, }, KindSchema { reason: String, }, ShareNotFound { tried: Vec<PathBuf>, }, StrictDiagnostics { count: usize, }, Git { reason: String, }, Io { path: PathBuf, source: Error, }, Transport(Error), Refused { code: u8, reason: String, }, Protocol { reason: String, }, Registry { errors: Vec<RegistryError>, }, Http { reason: String, }, Lease { reason: String, }, DeploymentNotFound { id: String, }, InvalidDeployment { reason: String, }, CapabilityNotFound { id: String, }, NotFound { reason: String, }, InvalidPolicy { path: PathBuf, reason: String, }, InvalidProjection { target: String, reason: String, }, InvalidSurface { surface: String, reason: String, }, InvalidDistribution { path: String, reason: String, }, InvalidRelease { path: String, reason: String, }, InvalidDesign { path: String, reason: String, }, InvalidSource { path: String, reason: String, }, UnresolvedRelation { findings: Vec<String>, }, Stale { files: Vec<String>, },
}
Expand description

Everything that stops a command.

Variants§

§

RepositoryNotFound

No ancestor of the start directory carries .ai/manifest.yaml.

Fields

§start: PathBuf

Where the search began.

§

LegacyLayout

Project data sits under .majordomus/ with no manifest: the pre-.ai layout.

Fields

§root: PathBuf

The directory that holds the legacy layout.

§

InvalidManifest

The manifest does not parse, or a constraint of its schema fails.

Fields

§path: PathBuf

The manifest.

§reason: String

What is wrong.

§

UnsupportedSchema

The manifest declares a layer schema this executable does not read.

Fields

§path: PathBuf

The manifest.

§found: String

The schema declared.

§supported: String

The schema this executable reads.

§

InvalidSources

sources.yaml does not parse or contradicts its own rules.

Fields

§path: PathBuf

The sources file.

§reason: String

What is wrong.

§

InvalidScope

scope.yaml does not parse or contradicts its own rules.

Fields

§path: PathBuf

The scope file.

§reason: String

What is wrong.

§

UnknownKeys

A file carries keys nothing reads.

Fields

§path: PathBuf

The file.

§keys: Vec<String>

The key paths, in document order.

§

KindSchema

A kinds file or a schema file cannot be used: malformed, contradictory, or redefining a distributed one.

Fields

§reason: String

What is wrong, with the file named.

§

ShareNotFound

No directory tried holds kinds.yaml.

Fields

§tried: Vec<PathBuf>

Every directory looked at, in order.

§

StrictDiagnostics

--strict was given and the index carries error diagnostics.

Fields

§count: usize

How many.

§

Git

git could not be run or answered with an error, where it was needed.

Fields

§reason: String

What git said.

§

Io

A file or directory could not be read or written.

Fields

§path: PathBuf

The path.

§source: Error

The underlying error.

§

Transport(Error)

The stdio transport failed to read or write.

§

Refused

A subsystem refused an operation and carries its own message and exit code. The message is the subsystem’s, complete, and is printed as it is: rephrasing an actionable refusal into a generic one is how a person loses the corrective command.

Fields

§code: u8

The exit code the subsystem’s own contract assigns.

§reason: String

What failed, why, what was involved, and what to run instead.

§

Protocol

A protocol frame could not be encoded, or an internal answer could not be produced.

Fields

§reason: String

What is wrong.

§

Registry

The capability registry does not build; every violation is listed.

Fields

§errors: Vec<RegistryError>

The violations, in id order.

§

Http

The HTTP projection failed: a port that cannot be bound, or an OpenAPI document that cannot be built.

Fields

§reason: String

What is wrong.

§

Lease

The shared server’s lease could not be acquired or joined.

Fields

§reason: String

What is wrong.

§

DeploymentNotFound

A deployment was named that the layer does not declare.

Fields

§id: String

The id asked for.

§

InvalidDeployment

A deployment object exists and cannot be read as one.

Fields

§reason: String

What is wrong, with the file, the key, the value and the correction.

§

CapabilityNotFound

No capability has this id.

Fields

§id: String

The id asked for.

§

NotFound

A caller named something this repository does not hold. Not the caller’s fault in the sense an internal error is: the request was well formed and the thing is absent, which is the missing-artifact code and not the internal one.

Fields

§reason: String

What was asked for and where the caller can see what exists.

§

InvalidPolicy

The policy file does not parse, or does not carry what the projections need.

Fields

§path: PathBuf

The policy file.

§reason: String

What is wrong.

§

InvalidProjection

A declared provider projection cannot be produced.

Fields

§target: String

The declared target.

§reason: String

What is wrong.

§

InvalidSurface

A web surface’s declaration cannot be read, or the topology it would join is not valid.

Fields

§surface: String

The surface’s id, or the declaration’s path when the id is what is wrong.

§reason: String

What is wrong, and what to do about it.

§

InvalidDistribution

The distribution model cannot be read, or it breaks an invariant of its own contract.

Fields

§path: String

Where the model was read from.

§reason: String

What is wrong, and what to do about it.

§

InvalidRelease

A release record cannot be read, or it disagrees with the distribution model.

Fields

§path: String

Where the record was read from.

§reason: String

What is wrong, and what to do about it.

§

InvalidDesign

The design declaration, or a projection rendered from it, is inconsistent: a role naming no palette entry, a state word filed under two meanings, a value the CSS parser would drop in silence. Nothing is written.

Fields

§path: String

The declaration, or the projection that could not be rendered.

§reason: String

What is wrong.

§

InvalidSource

A Rust source file of the crate under inspection cannot be read or parsed, so the quality inventory would be built over less than the whole crate. Reported rather than skipped: a partial inventory that looked clean would be the one result this subsystem must never produce.

Fields

§path: String

The file, crate-relative when it is inside the crate.

§reason: String

What is wrong, and what to do about it.

§

UnresolvedRelation

The layer names something this repository does not hold, so the graph composed from it would carry a reference to nothing. Nothing is written: a published graph whose reference resolves to no node is a naming defect a reader cannot see, and every regeneration would reproduce it.

Fields

§findings: Vec<String>

One line per finding: the file, the key, what was named, and the correction.

§

Stale

generate --check found committed projections that differ from the registry, or are missing.

Fields

§files: Vec<String>

Each stale file with (differs) or (missing).

Implementations§

Source§

impl Error

Source

pub fn exit_code(&self) -> u8

The process exit code this error maps to, per the exit-code contract.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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