pub enum OakError {
Show 75 variants
DiskFull {
path: String,
},
RepoNotFound,
RepoAlreadyExists,
NoCommits,
InvalidHash(String),
InvalidPath(String),
BlobNotFound(String),
CommitNotFound(String),
BranchNotFound(String),
BranchAlreadyExists(String),
BranchClosed(String),
NoEdits,
ManifestNotFound(String),
UncommittedChanges,
WorktreeCaptureRaced {
detail: String,
},
UnsupportedChangeCaptureFormat(String),
ChangeCaptureScopeExcluded {
path: String,
reason: String,
remedy: String,
},
CapturedBlobIntegrity {
path: String,
hash: String,
detail: String,
},
CapturedTreeIntegrity {
hash: String,
detail: String,
},
ChangeCaptureNotFound {
capture_id: String,
},
ChangeCaptureIntegrity {
capture_id: String,
detail: String,
},
DirtyWorkingTree(String),
ConflictDetected,
LocalCommitsNotInRemoteHistory,
RemoteCommitsNotInLocalHistory,
RemoteNotConfigured,
RemoteMoved {
origin: String,
},
RemoteRepoNotFound(String),
RemoteRepoAlreadyExists(String),
MergeFailed(String),
IncompleteAncestry {
left: String,
right: String,
missing: String,
},
IncompleteManifestData {
left: String,
right: String,
missing: String,
},
IncompleteCommitData {
context: String,
missing: String,
},
IncompleteBlobData {
context: String,
missing: String,
},
NoVerifiedCommonAncestor {
left: String,
right: String,
},
MergeConflict(usize),
MergeInvariantViolation {
detail: String,
next_commands: Vec<String>,
},
MergePredictionUncertified {
detail: String,
next_commands: Vec<String>,
},
IntegrityInconclusive {
detail: String,
recommended_next_commands: Vec<String>,
},
CloneAdmissionTokenTooLarge {
detail: String,
recommended_next_commands: Vec<String>,
},
IntegrityAdmissionBusy(String),
MergeInProgress,
InterruptedWorktreeUpdate {
message: String,
next_commands: Vec<String>,
},
LocalChangesWouldBeOverwritten {
command: String,
clean_command: Option<String>,
transition: WorktreeTransition,
paths: Vec<(String, String)>,
total: usize,
in_the_way: bool,
},
NoMergeInProgress,
NoSyncInProgress,
TrunkIsServerOnly(String),
NotLoggedIn {
remote: String,
},
RepoNotLinked(String),
FeedbackFailed {
message: String,
usage: bool,
code: ErrorCode,
retryable: Option<bool>,
next_commands: Vec<String>,
transition: Option<Value>,
},
RootRefused {
reason: RootRefusal,
message: String,
paths: Vec<String>,
next_commands: Vec<String>,
},
Io(Error),
Database(String),
Serialization(Error),
Http(String),
Server(String),
PublicationUnconfirmed {
operation: String,
reason: String,
reconciliation_commands: Vec<String>,
},
AuthRequired {
remote: String,
status: u16,
},
R2(String),
Git(String),
Config(String),
FinishPreflight(Box<FinishPreflightError>),
FinishPhaseFailed(Box<FinishPhaseError>),
CommitPhaseFailed(Box<CommitPhaseError>),
RepoLocked,
Unsupported {
backend: &'static str,
op: &'static str,
},
GroupNotFound(String),
InvalidArgument(String),
Usage(String),
DetachedHeadCommit(String),
RestrictedContent(String),
DescriptionStale {
branch: String,
state: DescriptionStaleState,
message: String,
refresh_commands: Vec<String>,
},
ApprovalRefused {
code: ErrorCode,
server_code: Option<String>,
message: String,
missing: Vec<MissingApproval>,
hidden: usize,
recommended_next_commands: Vec<String>,
},
PushCapabilityUnavailable {
message: String,
recommended_next_commands: Vec<String>,
},
PathOutsideView {
paths: Vec<String>,
recommended_next_commands: Vec<String>,
},
}Variants§
DiskFull
RepoNotFound
RepoAlreadyExists
NoCommits
InvalidHash(String)
InvalidPath(String)
BlobNotFound(String)
CommitNotFound(String)
BranchNotFound(String)
BranchAlreadyExists(String)
BranchClosed(String)
NoEdits
ManifestNotFound(String)
UncommittedChanges
WorktreeCaptureRaced
UnsupportedChangeCaptureFormat(String)
ChangeCaptureScopeExcluded
CapturedBlobIntegrity
CapturedTreeIntegrity
ChangeCaptureNotFound
ChangeCaptureIntegrity
DirtyWorkingTree(String)
ConflictDetected
LocalCommitsNotInRemoteHistory
RemoteCommitsNotInLocalHistory
RemoteNotConfigured
RemoteMoved
RemoteRepoNotFound(String)
RemoteRepoAlreadyExists(String)
MergeFailed(String)
IncompleteAncestry
IncompleteManifestData
IncompleteCommitData
IncompleteBlobData
NoVerifiedCommonAncestor
MergeConflict(usize)
MergeInvariantViolation
next_commands: the exact next steps the assessment that raised this
derived from its evidence (never oak merge).
MergePredictionUncertified
next_commands: as on OakError::MergeInvariantViolation.
IntegrityInconclusive
A remote content-integrity proof ran out of budget before it could conclude. This is neither proof of health nor evidence of missing content; callers must not treat it as either.
Fields
CloneAdmissionTokenTooLarge
The server’s clone admission (integrity snapshot) token is too large to send back in the pull request URL. Raised before the pull request is sent; nothing was downloaded. The token itself is never echoed.
Fields
IntegrityAdmissionBusy(String)
The server refused to start an integrity proof because it was busy and the client’s bounded wait for admission ran out. Nothing was downloaded or created.
MergeInProgress
InterruptedWorktreeUpdate
A working-tree update (pull, sync, reset, …) was killed part-way and
its record is still in .oak/WORKTREE_UPDATE. next_commands are the
exact recovery invocations.
LocalChangesWouldBeOverwritten
A working-tree transition (branch creation, pull, sync, switch, …)
would have overwritten uncommitted work: a path it writes holds
content that is neither the snapshot it moves from nor the one it
moves to, or something the user owns is in the way of it. Refused
before the first write. paths is a bounded sample of (path, why);
total counts them all. The message and the next commands are both
derived from transition and in_the_way, so they always agree.
Fields
transition: WorktreeTransitionNoMergeInProgress
NoSyncInProgress
oak pull --continue / --abort with no paused parent sync.
TrunkIsServerOnly(String)
The named branch is the trunk, which exists only on the server and is never checked out locally.
NotLoggedIn
No stored credential for remote. Nothing was sent.
RepoNotLinked(String)
The checkout is not linked to a remote repository yet; linking it
(oak push --repo ORG/REPO) is the fix.
FeedbackFailed
An oak feedback request failed. Feedback keeps its own exit code
(1) for remote failures; code is the closed machine code, and
retryable is set only where the caller knows the answer.
Fields
RootRefused
oak root pull|push refused before changing anything.
Fields
reason: RootRefusalIo(Error)
Database(String)
Serialization(Error)
Http(String)
Server(String)
PublicationUnconfirmed
AuthRequired
R2(String)
Git(String)
Config(String)
FinishPreflight(Box<FinishPreflightError>)
FinishPhaseFailed(Box<FinishPhaseError>)
CommitPhaseFailed(Box<CommitPhaseError>)
RepoLocked
Unsupported
GroupNotFound(String)
InvalidArgument(String)
Usage(String)
The command line itself was rejected by the argument parser (unknown
flag, missing value, conflicting flags). Unlike InvalidArgument,
which is also raised for conditions that can change, this can never
succeed unchanged.
DetachedHeadCommit(String)
oak commit on a detached HEAD: there is no branch to record onto.
RestrictedContent(String)
The server withheld content because a path-based permission rule denies this user (an access boundary on the server). Not a data gap — the fix is an access grant, not a re-pull. The message names what was withheld (paths when known, blob hashes otherwise).
DescriptionStale
A read-modify-write of the branch description (oak desc --append)
was refused because the local copy is not a verified image of the
remote one. Nothing was written locally or remotely. state is a
stable machine label (pending_local_edit, remote_changed,
remote_unverified); refresh_commands are exact commands that bring
the local copy up to date or let the caller inspect both sides.
ApprovalRefused
The approvals gate or oak approve refused (code says why). Waiting
never clears it.
Fields
server_code: Option<String>The reason exactly as the server sent it, when this client does
not know it (code is then ErrorCode::ApprovalRefused).
missing: Vec<MissingApproval>Other boundaries missing an approval, which the caller can’t read.
Publication is impossible with the protocols the server advertises
(for example the push needs staged_v1 and the server has not
activated it). A deterministic server-capability refusal, not a usage
error: retrying unchanged cannot succeed until the server’s
capabilities or the outgoing history change. message names the
measured totals and the limits they exceed and says whether remote
state was mutated.
PathOutsideView
A partial checkout (a view) holds work outside its directories: the server would refuse the push, so it’s caught before the commit.
Implementations§
Source§impl OakError
impl OakError
Sourcepub fn in_transition(self, kind: WorktreeTransition) -> Self
pub fn in_transition(self, kind: WorktreeTransition) -> Self
Name the transition a OakError::LocalChangesWouldBeOverwritten
refused, so its message and next commands fit it. Any other error is
returned unchanged.
Sourcepub fn kind(&self) -> OakErrorKind
pub fn kind(&self) -> OakErrorKind
Which variant this is. Exhaustive on purpose (no wildcard arm).
Trait Implementations§
Source§impl Error for OakError
impl Error for OakError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for OakError
impl !UnwindSafe for OakError
impl Forget for OakError
impl Freeze for OakError
impl Move for OakError
impl Send for OakError
impl Sync for OakError
impl Unpin for OakError
impl UnsafeUnpin for OakError
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§fn raise_typed(self) -> Exn<Self>where
Self: Sized,
fn raise_typed(self) -> Exn<Self>where
Self: Sized,
Self even when it is already an Error.Source§fn and_raise_typed<T>(self, context: T) -> Exn<T>
fn and_raise_typed<T>(self, context: T) -> Exn<T>
Self::and_raise(), retaining the context’s type in an exception.Source§fn raise_erased(self) -> Exnwhere
Self: Sized,
fn raise_erased(self) -> Exnwhere
Self: Sized,
crate::Error values reuse their existing frame and caller location.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