Skip to main content

RepographError

Enum RepographError 

Source
pub enum RepographError {
    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),
}
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.

Fields

§path: PathBuf
§source: Error
§

NotFound

A required entity does not exist (repo, workspace, path).

Fields

§kind: &'static str
§name: String
§

Conflict

A unique-constraint violation (name or path already registered).

Fields

§kind: &'static str
§name: String
§

PermissionDenied

Explicit permission failure (raised when we can attribute it to a known path).

Fields

§path: PathBuf
§

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.

Fields

§kind: &'static str
§name: String
§reason: &'static str
§

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.

Fields

§count: u32
§

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.

Implementations§

Source§

impl RepographError

Source

pub fn exit_code(&self) -> u8

Map this error to the documented exit code: 1 general, 3 not-found, 4 permission-denied, 5 conflict.

Trait Implementations§

Source§

impl Debug for RepographError

Source§

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

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

impl Display for RepographError

Source§

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

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

impl Error for RepographError

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<Error> for RepographError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for RepographError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for RepographError

Source§

fn from(source: Error) -> 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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