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
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
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
reason: StaleReasonWhat 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
impl Debug for ManageError
Source§impl Display for ManageError
impl Display for ManageError
Source§impl Error for ManageError
impl Error for ManageError
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()
Source§impl From<Error> for ManageError
impl From<Error> for ManageError
Source§impl From<Error> for ManageError
impl From<Error> for ManageError
Source§impl From<ObjectStoreError> for ManageError
impl From<ObjectStoreError> for ManageError
Source§fn from(source: ObjectStoreError) -> Self
fn from(source: ObjectStoreError) -> Self
Source§impl From<PackchainError> for ManageError
impl From<PackchainError> for ManageError
Source§fn from(source: PackchainError) -> Self
fn from(source: PackchainError) -> Self
Auto Trait Implementations§
impl Freeze for ManageError
impl !RefUnwindSafe for ManageError
impl Send for ManageError
impl Sync for ManageError
impl Unpin for ManageError
impl UnsafeUnpin for ManageError
impl !UnwindSafe for ManageError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ErrorExt for T
impl<T> ErrorExt for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.