Skip to main content

CliError

Enum CliError 

Source
#[non_exhaustive]
pub enum CliError {
Show 35 variants Io { path: String, source: Error, }, Manifest(ManifestError), Validation(ValidationErrors), Expand(ExpandError), Graph(GraphBuildError), DoraMigrate(DoraMigrateError), Ros2Migrate(Ros2MigrateError), Daemon(DaemonError), Coordinator(CoordinatorError), Store(Error), Transport(TransportError), Runtime(RuntimeError), Node(NodeError), Recording(RecordingError), Rosbag(RosbagError), Ros2(String), Tui(TuiError), CoordinatorSource(CoordinatorSourceError), Replay(ReplaySourceError), Refused { request: &'static str, message: String, }, UnexpectedReply { request: &'static str, reply: &'static str, }, NoToken { env: &'static str, file: &'static str, }, BadToken { path: String, source: AuthTokenError, }, BadAddress { input: String, reason: String, }, BadArgument { flag: &'static str, value: String, reason: String, }, Cluster { action: &'static str, process: &'static str, reason: String, }, NoCluster { detail: String, }, UnknownDataflow { reference: String, reason: String, }, AlreadyRunning { process: &'static str, pid: u32, address: String, }, NotImplementedYet { verb: &'static str, wave: &'static str, }, FeatureNotEnabled { feature: &'static str, wave: &'static str, }, ProofUnavailable, DeterministicNeedsRecording, UnsafePath { path: String, }, TargetExists { path: String, },
}
Expand description

Everything that can abort an astrs command outright.

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

Io

A file could not be read or written.

Fields

§path: String

The path that could not be accessed.

§source: Error

The underlying I/O error.

§

Manifest(ManifestError)

The manifest did not even parse as YAML.

§

Validation(ValidationErrors)

The manifest parsed but failed structural validation.

§

Expand(ExpandError)

Module expansion failed.

§

Graph(GraphBuildError)

The (validated, expanded) manifest could not become a dataflow graph.

§

DoraMigrate(DoraMigrateError)

migrate from-dora failed.

§

Ros2Migrate(Ros2MigrateError)

migrate from-ros2 failed.

§

Daemon(DaemonError)

The embedded daemon (astrs run) or the hidden astrs daemon process failed.

§

Coordinator(CoordinatorError)

The hidden astrs coordinator process failed.

§

Store(Error)

The coordinator’s parameter/state store could not be opened.

§

Transport(TransportError)

A connection to the coordinator failed.

§

Runtime(RuntimeError)

The hidden astrs runtime process failed.

§

Node(NodeError)

A node could not connect to its daemon (astrs runtime).

§

Recording(RecordingError)

An .arec recording could not be read (astrs bag info, astrs replay).

§

Rosbag(RosbagError)

A rosbag2 .db3/.mcap file could not be read or written, or a requested astrs bag convert direction is not one this build bridges (astrs bag info, astrs bag convert).

§

Ros2(String)

The astrs ros2 probe could not join the DDS domain, or its report could not be rendered (blueprint §17, §10.2).

A finding — an empty domain, a refused multicast join — is never this: ros2 doctor reports those as checks. This is the case where there is nothing to report on because the participant itself would not start.

§

Tui(TuiError)

astrs top could not enter or run the terminal (blueprint §17).

§

CoordinatorSource(CoordinatorSourceError)

astrs top could not connect to the coordinator.

§

Replay(ReplaySourceError)

astrs top --replay could not open its recording.

§

Refused

The coordinator answered a request with an error reply.

Fields

§request: &'static str

The request that was refused, e.g. "list".

§message: String

The coordinator’s own message.

§

UnexpectedReply

The coordinator answered with a reply this verb cannot use — a protocol violation rather than a refusal.

Fields

§request: &'static str

The request that was sent.

§reply: &'static str

The reply variant that came back.

§

NoToken

No cluster token could be found, and the verb needs one (§16).

Fields

§env: &'static str

The environment variable that would have supplied it.

§file: &'static str

The conventional file name (§16).

§

BadToken

A token was found but is not a 64-hex value (§16).

Fields

§path: String

Where the bad token came from.

§source: AuthTokenError

Why it was rejected.

§

BadAddress

A host[:port] (or bare port) argument could not be resolved.

Fields

§input: String

What the user typed.

§reason: String

Why it could not be used.

§

BadArgument

A flag’s value was not of the shape the flag needs.

Fields

§flag: &'static str

The flag, without its leading dashes.

§value: String

The value that was rejected.

§reason: String

Why it was rejected.

§

Cluster

A cluster process could not be started or stopped.

Fields

§action: &'static str

What was attempted, e.g. "start".

§process: &'static str

Which process, e.g. "coordinator".

§reason: String

Why it failed.

§

NoCluster

A verb that needs a live cluster found none.

Fields

§detail: String

What the probe actually observed.

§

UnknownDataflow

A dataflow reference named nothing the coordinator knows (or named more than one thing).

Fields

§reference: String

What the user typed.

§reason: String

What was found instead.

§

AlreadyRunning

A cluster process is already running here, and the verb refuses to start a second one over it.

Fields

§process: &'static str

Which process, e.g. "coordinator".

§pid: u32

Its process id, from the pidfile (§24.2).

§address: String

Where it listens, rendered with a leading separator, or empty.

§

NotImplementedYet

A verb (or a flag on one) whose implementation belongs to a wave this build predates.

Fields

§verb: &'static str

The verb (or group subcommand) that was invoked, e.g. "node add" or "ros2 doctor".

§wave: &'static str

The wave this verb is scheduled for, e.g. crate::command::stub::WAVE_BAG.

§

FeatureNotEnabled

An optional feature exists as a stub but is gated behind a Cargo feature this build does not enable.

Fields

§feature: &'static str

The Cargo feature name, e.g. "verify".

§wave: &'static str

The wave this feature is scheduled for, e.g. "W5/W6".

§

ProofUnavailable

astrs validate --prove ran on a build without the verify feature, so no solver was available to discharge the obligations.

Distinct from Self::FeatureNotEnabled, which says a feature has not shipped yet: verify has shipped, and the obligations were still encoded and printed — only the verdicts are missing.

§

DeterministicNeedsRecording

run --deterministic was given without --from-recording.

Refused before anything is built or spawned (blueprint §14) — a user who asks for a deterministic run never gets a non-deterministic one wearing the label, because there is nothing to fix the timer wheel to without a recording.

§

UnsafePath

new refused to write outside its target directory.

Fields

§path: String

The offending resolved path.

§

TargetExists

new was asked to write into a directory that already has conflicting files in it.

Fields

§path: String

The offending path.

Implementations§

Source§

impl CliError

Source

pub fn io(path: impl AsRef<Path>, source: Error) -> Self

Build a CliError::Io from a path and the I/O failure accessing it.

Source

pub fn exit_code(&self) -> i32

The process exit code this error should produce.

Self::NotImplementedYet, Self::FeatureNotEnabled and Self::ProofUnavailable use EXIT_UNAVAILABLE so scripts can tell “this build cannot do that” apart from an ordinary failure; everything else is a plain 1 (EXIT_FAILURE), matching every other Unix CLI tool’s default.

Trait Implementations§

Source§

impl Debug for CliError

Source§

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

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

impl Display for CliError

Source§

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

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

impl Error for CliError

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<CoordinatorError> for CliError

Source§

fn from(source: CoordinatorError) -> Self

Converts to this type from the input type.
Source§

impl From<CoordinatorSourceError> for CliError

Source§

fn from(source: CoordinatorSourceError) -> Self

Converts to this type from the input type.
Source§

impl From<DaemonError> for CliError

Source§

fn from(source: DaemonError) -> Self

Converts to this type from the input type.
Source§

impl From<DoraMigrateError> for CliError

Source§

fn from(source: DoraMigrateError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for CliError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ExpandError> for CliError

Source§

fn from(source: ExpandError) -> Self

Converts to this type from the input type.
Source§

impl From<GraphBuildError> for CliError

Source§

fn from(source: GraphBuildError) -> Self

Converts to this type from the input type.
Source§

impl From<ManifestError> for CliError

Source§

fn from(source: ManifestError) -> Self

Converts to this type from the input type.
Source§

impl From<NodeError> for CliError

Source§

fn from(source: NodeError) -> Self

Converts to this type from the input type.
Source§

impl From<RecordingError> for CliError

Source§

fn from(source: RecordingError) -> Self

Converts to this type from the input type.
Source§

impl From<ReplaySourceError> for CliError

Source§

fn from(source: ReplaySourceError) -> Self

Converts to this type from the input type.
Source§

impl From<Ros2MigrateError> for CliError

Source§

fn from(source: Ros2MigrateError) -> Self

Converts to this type from the input type.
Source§

impl From<RosbagError> for CliError

Source§

fn from(source: RosbagError) -> Self

Converts to this type from the input type.
Source§

impl From<RuntimeError> for CliError

Source§

fn from(source: RuntimeError) -> Self

Converts to this type from the input type.
Source§

impl From<TransportError> for CliError

Source§

fn from(source: TransportError) -> Self

Converts to this type from the input type.
Source§

impl From<TuiError> for CliError

Source§

fn from(source: TuiError) -> Self

Converts to this type from the input type.
Source§

impl From<ValidationErrors> for CliError

Source§

fn from(source: ValidationErrors) -> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeDebug for T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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> ToCompactString for T
where T: Display,

Source§

impl<T> ToLine for T
where T: Display,

Source§

fn to_line(&self) -> Line<'_>

Converts the value to a Line.
Source§

impl<T> ToSpan for T
where T: Display,

Source§

fn to_span(&self) -> Span<'_>

Converts the value to a Span.
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> ToText for T
where T: Display,

Source§

fn to_text(&self) -> Text<'_>

Converts the value to a Text.
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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