pub enum DispatchError {
Show 29 variants
UnsupportedScheme(String),
MalformedUrl(String),
NoHead,
Interrupted,
Transport(TransportError),
Refs(RefError),
RepoLock(LockError),
Discover(DiscoverError),
Io(Error),
Store(StoreError),
Pack(PackError),
PackList(PackListError),
SshInit(SshInitError),
DetachedHead,
RemoteBranchMissing(String),
NonFastForwardPull {
branch: String,
},
RestoreSafety(String),
NotCommit,
Restore(RestoreError),
UntrustedRemote(String),
NonFastForwardPush {
branch: String,
},
PackmapContended {
branch: String,
},
PackChainInvalid {
branch: String,
},
PackmapMissing(String),
AdvertisedPackMissing {
branch: String,
pack: String,
},
RemoteMissingObject(String),
ClosureTooLarge(usize),
UnsignedOrInvalidObject {
hash: String,
reason: String,
},
InvalidRemoteName(String),
}Expand description
Errors returned by the push / pull helpers. Mapped to exit codes by the commands themselves.
Variants§
UnsupportedScheme(String)
MalformedUrl(String)
NoHead
Interrupted
A poll-loop checkpoint observed signal::is_shutdown() == true
and aborted partway through. Callers should map this to
exit::TEMPFAIL (75) so retries are safe — the transfer is
half-finished but the remote is unmodified for any ref we
hadn’t reached yet.
Transport(TransportError)
Refs(RefError)
RepoLock(LockError)
Discover(DiscoverError)
Io(Error)
Store(StoreError)
Pack(PackError)
PackList(PackListError)
SshInit(SshInitError)
DetachedHead
RemoteBranchMissing(String)
NonFastForwardPull
RestoreSafety(String)
NotCommit
Restore(RestoreError)
UntrustedRemote(String)
The per-endpoint credential-trust gate (#97) refused to build a
credential-bearing transport for a repo-chosen endpoint the user
has not explicitly trusted. The wrapped string is the actionable
message produced by crate::config::endpoint_credential_trust.
NonFastForwardPush
A CAS ref write was rejected because the remote moved under us
(non-fast-forward). Callers map this to an actionable
fetch-then-retry / --force-with-lease hint.
PackmapContended
The branch’s packmap pointer could not be durably advanced under sustained concurrent pushes. The branch ref was NOT moved, so the remote stays consistent; the push is safe to retry.
PackChainInvalid
A packmap chain was malformed — it exceeded the depth cap, contained a cycle, or a node could not be downloaded/decoded. Indicates a corrupt or hostile remote.
PackmapMissing(String)
The remote advertised a branch ref but no packmap
(refs/mkit/packmap/<branch>) for it. mkit speaks a single,
packmap-only transfer dialect: the push path ALWAYS advertises a
packmap before moving the branch ref, so a branch with a tip but no
packmap is a corrupt/incomplete remote, not a format we degrade to.
We refuse to fetch rather than silently materialise a partial ref.
AdvertisedPackMissing
The packmap advertised a pack the remote does not hold. The branch’s closure cannot be reconstructed, so the fetch is aborted rather than publishing a ref to an incomplete history.
RemoteMissingObject(String)
After unpacking the branch’s whole packmap chain, an object reachable from the fetched tip is still absent from the local store — the chain did not deliver the full closure. This is a pure integrity assertion (no recovery download is attempted): the remote’s packmap is incomplete, so fetch aborts before publishing the ref.
ClosureTooLarge(usize)
The fetched tip’s object closure exceeds the
mkit_core::ops::graph::MAX_REACHABLE verification cap, so
completeness could not be confirmed. On the applied-pack skip path
(#409) this closure walk is the sole guarantee the local store is
whole; a truncated walk could silently pass over missing objects, so
we fail closed rather than publish a ref we can’t fully verify. This is
NOT a self-heal trigger.
UnsignedOrInvalidObject
A commit/remix/tag newly introduced by this fetch failed Ed25519
signature verification via mkit_core::sign::verify_commit /
verify_remix / verify_tag — the exact check mkit verify <rev>
runs manually (issue #692). A hostile remote (THREAT-MODEL §3.1) can
otherwise push an unsigned or forged history that clone/pull/
fetch would silently materialise. Deliberately distinct from
RemoteMissingObject so it does NOT
feed the applied-pack self-heal retry (#409): an invalid signature
is not evidence of local staleness, and clearing the applied-packs
record would not make a hostile remote’s history valid. Fails
closed by default; opt out with --no-verify-signatures or the
user-scoped pull.require_signed = false config (never settable
from repo-scoped config — see crate::config::REPO_FORBIDDEN_KEYS).
InvalidRemoteName(String)
A remote name passed to the applied-packs record (#409) is not a legal
ref name (per mkit_core::refs::validate_ref_name). A remote name
is a ref name, so this should never occur for a config-registered
remote; it is defence-in-depth against a malformed name being used as
a raw path component under .mkit/applied-packs/.
Trait Implementations§
Source§impl Debug for DispatchError
impl Debug for DispatchError
Source§impl Display for DispatchError
impl Display for DispatchError
Source§impl Error for DispatchError
impl Error for DispatchError
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<DiscoverError> for DispatchError
impl From<DiscoverError> for DispatchError
Source§fn from(source: DiscoverError) -> Self
fn from(source: DiscoverError) -> Self
Source§impl From<Error> for DispatchError
impl From<Error> for DispatchError
Source§impl From<LockError> for DispatchError
impl From<LockError> for DispatchError
Source§impl From<PackError> for DispatchError
impl From<PackError> for DispatchError
Source§impl From<PackListError> for DispatchError
impl From<PackListError> for DispatchError
Source§fn from(source: PackListError) -> Self
fn from(source: PackListError) -> Self
Source§impl From<RefError> for DispatchError
impl From<RefError> for DispatchError
Source§impl From<RestoreError> for DispatchError
impl From<RestoreError> for DispatchError
Source§fn from(source: RestoreError) -> Self
fn from(source: RestoreError) -> Self
Source§impl From<SshInitError> for DispatchError
impl From<SshInitError> for DispatchError
Source§fn from(source: SshInitError) -> Self
fn from(source: SshInitError) -> Self
Source§impl From<StoreError> for DispatchError
impl From<StoreError> for DispatchError
Source§fn from(source: StoreError) -> Self
fn from(source: StoreError) -> Self
Source§impl From<TransportError> for DispatchError
impl From<TransportError> for DispatchError
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for DispatchError
impl !UnwindSafe for DispatchError
impl Freeze for DispatchError
impl Send for DispatchError
impl Sync for DispatchError
impl Unpin for DispatchError
impl UnsafeUnpin for DispatchError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 more