pub enum RepographError {
Show 14 variants
Io(Error),
ConfigParse(Error),
ConfigWrite(Error),
GitOpen {
path: PathBuf,
source: Error,
},
NotFound {
kind: &'static str,
name: String,
},
Conflict {
kind: &'static str,
name: String,
},
PermissionDenied {
path: PathBuf,
},
UsageError(String),
InvalidName {
kind: &'static str,
name: String,
reason: &'static str,
},
NeedsInit(String),
DoctorErrorsFound {
count: u32,
},
UpdateFailed(String),
IndexMissing,
Index(String),
}Expand description
Domain error for the repograph core and binary. Each variant is wired to a
specific exit code documented in CLAUDE.md and the registry-core spec.
Variants§
Io(Error)
Generic I/O failure; permission-denied is detected and mapped to code 4.
ConfigParse(Error)
Config file present but not parseable as TOML.
ConfigWrite(Error)
Could not serialize config to TOML.
GitOpen
git2::Repository::open rejected the path.
NotFound
A required entity does not exist (repo, workspace, path).
Conflict
A unique-constraint violation (name or path already registered).
PermissionDenied
Explicit permission failure (raised when we can attribute it to a known path).
UsageError(String)
Runtime usage failure (e.g. no config-dir resolvable). CLI argument errors are handled by clap and exit with code 2 directly.
InvalidName
User-supplied identifier violates a naming rule (e.g. workspace name
fails the RFC 1123 label policy). Maps to exit code 2, matching how
clap reports bad arguments.
NeedsInit(String)
An interactive code path required a TTY but stdout was redirected, and
no non-interactive escape hatch (flag, env var) was provided. Maps to
exit code 2. The payload is the full user-visible guidance message
(e.g. “agents not configured; run repograph init” or “stdout is not
a TTY; pass --no-prompt --agents <list> …”).
DoctorErrorsFound
repograph doctor found one or more error-severity findings. The
report is the success output (already written to stdout); this variant
only carries the exit-code signal. Maps to exit code 1. The binary
special-cases this variant to suppress the generic “repograph failed”
tracing::error! line, since the report itself is the user-facing
surface, not the error message.
UpdateFailed(String)
repograph update failed to reach, download, or verify a release.
Covers network/IO failures and checksum/signature verification
failures. Maps to exit code 1. A binary-write permission failure is
reported through RepographError::PermissionDenied (exit 4)
instead, so this variant is reserved for general update failures.
IndexMissing
repograph find was invoked before any search index was built. The
index is a “resource” that does not exist yet, so this maps to exit
code 3 (not-found), mirroring a missing repo/workspace. The Display
text guides the user to repograph index.
Index(String)
The search index database is present but could not be opened, read, or
queried (corruption, a schema the binary can’t drive, a failed SQL
statement). Maps to exit code 1. A missing index is
RepographError::IndexMissing (exit 3) instead.
Implementations§
Trait Implementations§
Source§impl Debug for RepographError
impl Debug for RepographError
Source§impl Display for RepographError
impl Display for RepographError
Source§impl Error for RepographError
impl Error for RepographError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()