Skip to main content

Module error

Module error 

Source
Expand description

The astrs CLI’s single error type.

Every library-testable command function (command::validate::run, command::expand::run, …) returns Result<Report, CliError>. crate::dispatch maps the Err case to CliError::exit_code and a one-line message on the caller’s error sink — the only two things main.rs needs to turn into a process exit code (blueprint: “main maps to exit codes — no process::exit inside lib paths”).

Most commands realistically never return this as an Err: a diagnostic tool like validate or doctor embeds every failure mode (a manifest that fails to parse, a port that is not bindable) as content of its typed report instead, so the report itself is what a test asserts against. CliError exists for the failure modes that really do abort a command outright — an artifact generator (expand, graph, schema) with nothing sensible to print because its input never became a valid manifest, a refusal from the coordinator, a verb whose engine belongs to a later wave, or a path-safety violation in new.

Enums§

CliError
Everything that can abort an astrs command outright.

Constants§

EXIT_UNAVAILABLE
EX_UNAVAILABLE (sysexits.h §3): the requested command exists but the service it needs is not available. Used for CliError::NotImplementedYet and CliError::FeatureNotEnabled so a script can tell “this AstRS build doesn’t have this yet” apart from an ordinary usage or data error (exit code 1) without parsing the message text.