pub enum VcsError {
Show 16 variants
SnapshotAlreadyExists(SnapshotId),
SnapshotNotFound(SnapshotId),
BranchNotFound {
namespace: String,
name: String,
},
NonFastForward {
local_head: SnapshotId,
remote_head: SnapshotId,
},
RemoteUnreachable {
url: String,
cause: String,
},
AuthFailed {
url: String,
},
HashMismatch {
expected: SnapshotId,
actual: SnapshotId,
},
MergeRequired,
UncommittedChanges {
count: usize,
},
MergeNotImplemented,
InvalidSnapshotId(String),
InvalidBranchName(String),
Storage(String),
Json(Error),
Io(Error),
Internal(String),
}Variants§
SnapshotAlreadyExists(SnapshotId)
A snapshot with this ID already exists in the database.
This should only occur on SHA-256 hash collision (computationally infeasible)
or if commit() is called twice with identical namespace state.
SnapshotNotFound(SnapshotId)
The requested snapshot archive is not in the local database.
Callers must pull from a remote to fetch it.
BranchNotFound
No branch with this name in the namespace.
NonFastForward
The remote branch HEAD is not an ancestor of the local HEAD.
Caller must pull, merge, commit, then push.
RemoteUnreachable
The remote khive-sync server could not be reached.
AuthFailed
The remote rejected the request due to authentication failure.
HashMismatch
The archive stored at the remote has a different hash than expected. Indicates corruption or tampering.
MergeRequired
The remote has diverged from local history; a merge is required.
UncommittedChanges
checkout was blocked because there are uncommitted changes.
Pass force: true to discard them.
MergeNotImplemented
merge_branch was called but no MergeEngine has been registered.
Ships as the default until khive-merge is linked.
InvalidSnapshotId(String)
A SnapshotId string failed validation.
InvalidBranchName(String)
A branch name failed validation (must match ^[a-zA-Z0-9_-]{1,64}$).
Storage(String)
An underlying storage operation failed.
Json(Error)
JSON serialization or deserialization failed.
Io(Error)
An I/O operation failed (file system, network).
Internal(String)
An unexpected internal error.
Trait Implementations§
Source§impl Error for VcsError
impl Error for VcsError
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()