pub enum ErrorKind {
Usage,
NotFound,
Refused,
Drift,
Source,
Corrupt,
Unsupported,
Io,
Internal,
}Expand description
What kind of failure this is (RFC-105 D6).
The kind exists so callers can branch without reading prose: a script
checks the exit code, --json output carries the kind string, and a
library consumer matches the enum. Every variant answers a different
question about whose problem it is.
Variants§
Usage
Wrong arguments or flags for the situation. The user’s input.
NotFound
A capability, lockfile, agent, or catalog id that does not exist.
Refused
A never-overwrite guard fired: Tuff refused to clobber something.
Drift
Local changes block the operation; --force is usually the answer.
Source
A source failed: git, an OCI registry, the catalog, the network.
Corrupt
A file Tuff must parse is not valid: lockfile, manifest, config.
Unsupported
Understood but not supported: a newer schema, an unknown transport, an adapter that cannot express this capability.
Io
The filesystem said no.
Internal
An invariant Tuff itself broke. Always a bug worth reporting.
Implementations§
Source§impl ErrorKind
impl ErrorKind
Sourcepub fn exit_code(self) -> i32
pub fn exit_code(self) -> i32
The process exit code for this kind.
Three codes are what scripts actually branch on: 2 separates “you
typed it wrong” from a real failure, and 70 (the BSD EX_SOFTWARE
convention) separates “Tuff has a bug” from both, so a CI log can
tell them apart without parsing text. Everything else is 1.