Skip to main content

ManageError

Enum ManageError 

Source
pub enum ManageError {
    Store(ObjectStoreError),
    BranchNotFound(String),
    Protected(String),
    LockContended {
        branch: String,
        lock: String,
        ttl_seconds: i64,
    },
    PartialDelete {
        branch: String,
        undeleted: Vec<String>,
        attempted: usize,
    },
    InvalidBranch(String),
    Cancelled,
    Io(Error),
    Internal(String),
    StaleSnapshot {
        entity: String,
        reason: StaleReason,
    },
    Packchain(PackchainError),
}
Expand description

Errors surfaced by the management surface.

Variants§

§

Store(ObjectStoreError)

Underlying object-store call failed.

§

BranchNotFound(String)

delete-branch / protect / unprotect was invoked against a branch that has no objects under <prefix>/refs/heads/<branch>/.

§

Protected(String)

delete-branch was invoked against a branch that has a PROTECTED# marker. Mirrors the refusal the helper-protocol delete path emits so both surfaces share one wording.

§

LockContended

delete-branch could not acquire the per-ref LOCK#.lock because another writer (a concurrent git push / delete / compact) currently holds it. Mirrors the helper-protocol push path’s contention surface so both delete surfaces converge on the same “another operation in progress” wording. Issue #158: without this lock, a concurrent push that lands between the post-prompt re-list and the sweep is silently missed and the ref survives despite an apparent success.

Fields

§branch: String

Branch the lock guards.

§lock: String

Full lock key on the bucket (<prefix>/<ref>/LOCK#.lock). Operators copy this into a doctor invocation.

§ttl_seconds: i64

Lock TTL in seconds at the time of attempted acquisition, rendered into the operator-facing message so a tuned GIT_REMOTE_OBJECT_STORE_LOCK_TTL_SECONDS is visible.

§

PartialDelete

delete-branch swept the fresh listing but one or more per-key deletes failed with a non-NotFound error. The loop continues past each transient failure so the caller has a complete inventory of which keys survived; this variant carries that inventory verbatim.

Retry on the same branch is naturally idempotent — the re-list at the start of the next delete call will only show the surviving keys, and the same loop will try to delete them. A NotFound mid-sweep is tolerated and counts as success, so the undeleted field is strictly the set of keys whose deletes raised something else (Network, AccessDenied, etc.).

Fields

§branch: String

Branch the sweep ran against.

§undeleted: Vec<String>

Keys whose per-key delete returned a non-NotFound error. Stored verbatim so a retry-by-key tool can target exactly what survived.

§attempted: usize

Total number of keys the fresh listing yielded, for the operator-facing “N of M” framing in the error message.

§

InvalidBranch(String)

Branch name failed gix-validate’s strict ref-name check; we reject these at the management boundary so a value like foo/../bar cannot land as a literal substring of a stored object key.

§

Cancelled

User cancelled an interactive prompt via Ctrl+C or EOF. A deliberate “no” on a confirmation prompt is not an error — callers (ManageBranch::delete, fix_multiple_bundles) print “Aborted” and return Ok(()).

§

Io(Error)

I/O error from dialoguer or other non-store sources.

§

Internal(String)

A defensive invariant inside the management code was violated — for example a snapshot map lookup that the caller had previously proven to exist, or a prompter returning an out-of-range index. These should not happen in practice; surfacing them as a typed error keeps the helper from aborting the process.

§

StaleSnapshot

doctor’s top-of-run snapshot disagreed with a fresh re-check taken immediately before a mutating write — the on-bucket state changed under us between the snapshot LIST and the write. The canonical case (issue #138) is fix_head racing against a concurrent git push :<branch> or manage delete-branch: the operator picks a HEAD candidate from the snapshot, but by the time the prompt returns the chosen branch has been deleted. Writing HEAD anyway would reproduce the invalid-HEAD condition the doctor was trying to fix.

Carries the entity whose presence was re-verified (e.g. "refs/heads/main") and a StaleReason describing exactly what the re-check observed, so the operator-facing message names the branch and tells them to re-run the doctor.

Fields

§entity: String

The ref-path or other entity whose presence was re-verified.

§reason: StaleReason

What the re-check actually saw under that entity’s prefix.

§

Packchain(PackchainError)

Packchain engine surface error. Surfaced by the doctor’s engine-aware audit path. Carries the typed source so the main-level downcast can recognise transport failures and emit the categorical fatal: line.

Trait Implementations§

Source§

impl Debug for ManageError

Source§

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

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

impl Display for ManageError

Source§

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

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

impl Error for ManageError

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 ManageError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ManageError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ObjectStoreError> for ManageError

Source§

fn from(source: ObjectStoreError) -> Self

Converts to this type from the input type.
Source§

impl From<PackchainError> for ManageError

Source§

fn from(source: PackchainError) -> 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> ErrorExt for T
where T: Error + Send + Sync + 'static,

Source§

fn raise(self) -> Exn<Self>
where Self: Sized,

Raise this error as a new exception.
Source§

fn and_raise<T>(self, context: T) -> Exn<T>
where T: Error + Send + Sync + 'static, Self: Sized,

Raise this error as a child of a new exception with the given context error. Read more
Source§

fn raise_erased(self) -> Exn
where Self: Sized,

Raise this error as a new exception, with type erasure.
Source§

fn raise_all<T, I>(self, sources: I) -> Exn<Self>
where Self: Sized, T: Error + Send + Sync + 'static, I: IntoIterator, <I as IntoIterator>::Item: Into<Exn<T>>,

Raise this error as a new exception, with sources as causes.
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<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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