Skip to main content

OakError

Enum OakError 

Source
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

Fields

§path: String
§

RepoNotFound

§

RepoAlreadyExists

§

NoCommits

§

InvalidHash(String)

§

InvalidPath(String)

§

BlobNotFound(String)

§

CommitNotFound(String)

§

BranchNotFound(String)

§

BranchAlreadyExists(String)

§

BranchClosed(String)

§

NoEdits

§

ManifestNotFound(String)

§

UncommittedChanges

§

WorktreeCaptureRaced

Fields

§detail: String
§

UnsupportedChangeCaptureFormat(String)

§

ChangeCaptureScopeExcluded

Fields

§path: String
§reason: String
§remedy: String
§

CapturedBlobIntegrity

Fields

§path: String
§hash: String
§detail: String
§

CapturedTreeIntegrity

Fields

§hash: String
§detail: String
§

ChangeCaptureNotFound

Fields

§capture_id: String
§

ChangeCaptureIntegrity

Fields

§capture_id: String
§detail: String
§

DirtyWorkingTree(String)

§

ConflictDetected

§

LocalCommitsNotInRemoteHistory

§

RemoteCommitsNotInLocalHistory

§

RemoteNotConfigured

§

RemoteMoved

Fields

§origin: String
§

RemoteRepoNotFound(String)

§

RemoteRepoAlreadyExists(String)

§

MergeFailed(String)

§

IncompleteAncestry

Fields

§left: String
§right: String
§missing: String
§

IncompleteManifestData

Fields

§left: String
§right: String
§missing: String
§

IncompleteCommitData

Fields

§context: String
§missing: String
§

IncompleteBlobData

Fields

§context: String
§missing: String
§

NoVerifiedCommonAncestor

Fields

§left: String
§right: String
§

MergeConflict(usize)

§

MergeInvariantViolation

next_commands: the exact next steps the assessment that raised this derived from its evidence (never oak merge).

Fields

§detail: String
§next_commands: Vec<String>
§

MergePredictionUncertified

next_commands: as on OakError::MergeInvariantViolation.

Fields

§detail: String
§next_commands: Vec<String>
§

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

§detail: String
§recommended_next_commands: Vec<String>

Exact, shell-quoted invocations for the natural next step, in preference order (e.g. the narrower --shallow clone first).

§

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

§detail: String
§recommended_next_commands: Vec<String>

Exact, shell-quoted invocations that work from the caller’s working directory (the same clone with --shallow), or empty when no narrower retry of this invocation exists.

§

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.

Fields

§message: String
§next_commands: Vec<String>
§

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

§command: String

The refused invocation, shell-quoted, credentials redacted.

§clean_command: Option<String>

command with --clean added, when that is a valid invocation.

§paths: Vec<(String, String)>
§total: usize
§in_the_way: bool

Some path is in the way in a way a commit does not resolve (an ignored file, a file/directory obstruction, a name differing only in case): it has to be moved aside first.

§

NoMergeInProgress

§

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.

Fields

§remote: String
§

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

§message: String
§usage: bool

The request was malformed and nothing was sent (exit 2).

§retryable: Option<bool>
§next_commands: Vec<String>
§transition: Option<Value>

oak feedback transition only: what was sent and its outcome.

§

RootRefused

oak root pull|push refused before changing anything.

Fields

§message: String
§paths: Vec<String>

The paths in conflict (root_conflict), else empty.

§next_commands: Vec<String>
§

Io(Error)

§

Database(String)

§

Serialization(Error)

§

Http(String)

§

Server(String)

§

PublicationUnconfirmed

Fields

§operation: String
§reason: String
§reconciliation_commands: Vec<String>
§

AuthRequired

Fields

§remote: String
§status: u16
§

R2(String)

§

Git(String)

§

Config(String)

§

FinishPreflight(Box<FinishPreflightError>)

§

FinishPhaseFailed(Box<FinishPhaseError>)

§

CommitPhaseFailed(Box<CommitPhaseError>)

§

RepoLocked

§

Unsupported

Fields

§backend: &'static str
§op: &'static str
§

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.

Fields

§branch: String
§message: String
§refresh_commands: Vec<String>
§

ApprovalRefused

The approvals gate or oak approve refused (code says why). Waiting never clears it.

Fields

§code: ErrorCode

The closed code for the refusal reason.

§server_code: Option<String>

The reason exactly as the server sent it, when this client does not know it (code is then ErrorCode::ApprovalRefused).

§message: String
§hidden: usize

Other boundaries missing an approval, which the caller can’t read.

§recommended_next_commands: Vec<String>
§

PushCapabilityUnavailable

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.

Fields

§message: String
§recommended_next_commands: Vec<String>
§

PathOutsideView

A partial checkout (a view) holds work outside its directories: the server would refuse the push, so it’s caught before the commit.

Fields

§paths: Vec<String>
§recommended_next_commands: Vec<String>

Implementations§

Source§

impl OakError

Source

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.

Source

pub fn kind(&self) -> OakErrorKind

Which variant this is. Exhaustive on purpose (no wildcard arm).

Trait Implementations§

Source§

impl Debug for OakError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for OakError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for OakError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for OakError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for OakError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErrorExt for T
where T: Error + Send + Sync + 'static,

Source§

fn raise(self) -> Error
where Self: Sized,

Raise this error at the caller’s location, returning a public Error. An existing Error is returned unchanged, preserving its representation and allocation.
Source§

fn raise_typed(self) -> Exn<Self>
where Self: Sized,

Raise this error as a typed exception, retaining Self even when it is already an Error.
Source§

fn and_raise<T>(self, context: T) -> Error
where T: Error + Send + Sync + 'static, Self: Sized,

Raise this error as a cause of context, returning a public Error. Read more
Source§

fn and_raise_typed<T>(self, context: T) -> Exn<T>
where T: Error + Send + Sync + 'static, Self: Sized,

Like Self::and_raise(), retaining the context’s type in an exception.
Source§

fn raise_erased(self) -> Exn
where Self: Sized,

Raise this error as a new exception, with type erasure. Tree-backed crate::Error values reuse their existing frame and caller location.
Source§

fn raise_all<T, I>(self, sources: I) -> Exn<Self>
where Self: Sized, T: Error + Send + Sync + 'static, I: IntoIterator, <I as IntoIterator>::Item: Into<Exn<T>>,

Raise this error as a new exception, with sources as causes.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.