#[non_exhaustive]pub enum Error {
Show 22 variants
NotARepository(String),
ForbiddenBareRepository(String),
DubiousOwnership(String),
UnsupportedRepositoryFormatVersion(u32),
UnsupportedRepositoryExtension(String),
InvalidObjectId(String),
ObjectNotFound(String),
CorruptObject(String),
UnknownObjectType(String),
ObjectHeaderTooLong {
oid: String,
},
Io(Error),
Zlib(String),
LooseHashMismatch {
path: String,
real_oid: String,
},
IndexError(String),
CacheTreeCorrupt,
InvalidRef(String),
PathError(String),
ConfigError(String),
Signing(String),
Auth(String),
PushOptionsUnsupported,
Message(String),
}Expand description
The top-level error type for all Gust library operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotARepository(String)
A repository could not be found or is structurally invalid.
ForbiddenBareRepository(String)
A bare repository was found but access is forbidden by safe.bareRepository.
DubiousOwnership(String)
The repository is owned by a different user (safe.directory).
UnsupportedRepositoryFormatVersion(u32)
Repository format version is not supported by this implementation.
UnsupportedRepositoryExtension(String)
Repository declares an unsupported extension.
InvalidObjectId(String)
A supplied object ID string was not valid hex or the wrong length.
ObjectNotFound(String)
The requested object does not exist in the object store.
CorruptObject(String)
An object’s stored data is corrupt or malformed.
UnknownObjectType(String)
An unsupported or unknown object type was encountered.
ObjectHeaderTooLong
Loose object header type field exceeds Git’s 32-byte limit.
Io(Error)
An I/O error from the underlying filesystem.
Zlib(String)
A zlib compression or decompression failure.
LooseHashMismatch
Loose object bytes hash to a different OID than the file path implies (git fsck / read_loose_object).
Fields
IndexError(String)
The index file is missing, truncated, or has a bad header.
CacheTreeCorrupt
The cache-tree extension references more entries than the index contains. Git emits this
(verbatim, prefixed with error: ) when a tree with duplicate path entries is read into the
index (t4058-diff-duplicates).
InvalidRef(String)
A reference name or value is invalid.
PathError(String)
A general path-related error (invalid UTF-8, out-of-bounds, etc.).
ConfigError(String)
A configuration file parsing or access error.
Signing(String)
A commit/tag signing or signature-verification error.
Auth(String)
HTTP authentication failed: the server required credentials (401) and
either no credential provider was wired, the provider could not supply a
usable username/password, the server demanded an unsupported auth scheme,
or the supplied credentials were rejected.
Distinct from Error::Message so embedders can detect an authentication
failure (and e.g. fall back to an interactive/subprocess path) rather than
string-matching, and so the failure surfaces typed instead of hanging.
PushOptionsUnsupported
A push carried --push-option values but the remote git-receive-pack
did not advertise the push-options capability, so the options cannot be
transmitted.
Distinct from Error::Message so embedders can detect this specific
negotiation failure (and e.g. fall back to a subprocess push) rather than
string-matching. The message matches Git’s
fatal: the receiving end does not support push options.
Message(String)
User-facing message that should be printed verbatim (no extra prefix).
Used for revision errors that must match Git’s fatal: lines exactly.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()