Skip to main content

BranchError

Enum BranchError 

Source
pub enum BranchError {
Show 26 variants InvalidConfig(String), PermissionDenied(String), WorkspaceIsolationViolation { expected: Uuid, found: Uuid, }, InvalidBranchName(String), BranchLimitExceeded, Database(Error), Migration(MigrateError), Io(Error), Serialization(Error), BranchNotFound(Uuid), BranchAlreadyExists(String), BranchNotActive { id: Uuid, status: String, }, SnapshotFailed { branch_id: Uuid, reason: String, }, SnapshotCorrupt { branch_id: Uuid, path: PathBuf, }, SnapshotHashMissing { branch_id: Uuid, path: PathBuf, }, MergeConflictUnresolved { entity_ids: Vec<String>, }, MergeIncompatibleBase { ours: Uuid, theirs: Uuid, reason: String, }, DagCycle { from: Uuid, to: Uuid, }, CycleDetected { from: Uuid, to: Uuid, }, DagNodeNotFound(Uuid), DiffFailed { branch_a: Uuid, branch_b: Uuid, reason: String, }, CommitValidationFailed { branch_id: Uuid, violations: Vec<String>, }, SandboxError(String), MetricsError(String), NamingError(String), OrphanedSnapshot(PathBuf),
}
Expand description

Enumerates errors produced by branching, snapshotting, merging, and metrics code.

Variants§

§

InvalidConfig(String)

Indicates a runtime configuration is invalid.

§

PermissionDenied(String)

Indicates permission checks denied the operation.

§

WorkspaceIsolationViolation

Indicates branch data escaped workspace-scoped query isolation.

Fields

§expected: Uuid

The expected workspace id configured for this engine.

§found: Uuid

The unexpected workspace id returned by persistence.

§

InvalidBranchName(String)

Indicates a branch name failed strict path-safe validation.

§

BranchLimitExceeded

Indicates the workspace has reached its configured branch limit.

§

Database(Error)

Wraps SQLx database failures.

§

Migration(MigrateError)

Wraps SQLx migration failures.

§

Io(Error)

Wraps filesystem errors.

§

Serialization(Error)

Wraps JSON serialization errors.

§

BranchNotFound(Uuid)

Indicates a branch lookup failed.

§

BranchAlreadyExists(String)

Indicates a workspace already has a branch with the same logical name.

§

BranchNotActive

Indicates an operation requires an active branch.

Fields

§id: Uuid

The branch identifier that failed the active-state check.

§status: String

The current lifecycle status string for the branch.

§

SnapshotFailed

Indicates snapshot creation or restore failed.

Fields

§branch_id: Uuid

The branch identifier associated with the snapshot failure.

§reason: String

The human-readable failure reason.

§

SnapshotCorrupt

Indicates a snapshot file failed integrity validation.

Fields

§branch_id: Uuid

The branch identifier associated with the corrupt snapshot.

§path: PathBuf

The path to the corrupt snapshot file.

§

SnapshotHashMissing

Indicates a required snapshot hash sidecar file is missing.

Fields

§branch_id: Uuid

The branch identifier associated with the missing hash sidecar.

§path: PathBuf

The path to the expected sidecar hash file.

§

MergeConflictUnresolved

Indicates merge conflicts were not fully resolved.

Fields

§entity_ids: Vec<String>

The entity identifiers that still have unresolved conflicts.

§

MergeIncompatibleBase

Indicates two branches cannot be merged with the selected base.

Fields

§ours: Uuid

The local branch identifier.

§theirs: Uuid

The incoming branch identifier.

§reason: String

The reason the base is incompatible.

§

DagCycle

Indicates a lineage edge would create a DAG cycle.

Fields

§from: Uuid

The proposed source branch id.

§to: Uuid

The proposed destination branch id.

§

CycleDetected

Indicates a branch operation would introduce a lineage cycle.

Fields

§from: Uuid

The proposed source branch id.

§to: Uuid

The proposed destination branch id.

§

DagNodeNotFound(Uuid)

Indicates a DAG node lookup failed.

§

DiffFailed

Indicates diff extraction failed.

Fields

§branch_a: Uuid

The first branch identifier in the failed diff.

§branch_b: Uuid

The second branch identifier in the failed diff.

§reason: String

The human-readable diff failure reason.

§

CommitValidationFailed

Indicates a selective commit failed validation.

Fields

§branch_id: Uuid

The branch identifier whose commit was rejected.

§violations: Vec<String>

The list of validation violations.

§

SandboxError(String)

Indicates sandbox execution failed.

§

MetricsError(String)

Indicates metrics handling failed.

§

NamingError(String)

Indicates a branch name failed validation.

§

OrphanedSnapshot(PathBuf)

Indicates an orphaned snapshot path was encountered.

Implementations§

Source§

impl BranchError

Source

pub fn is_not_found(&self) -> bool

Returns true if this error indicates a missing branch or DAG node.

Source

pub fn is_merge_conflict(&self) -> bool

Returns true if this error represents an unresolved merge conflict.

Source

pub fn is_snapshot_error(&self) -> bool

Returns true if this error belongs to the snapshot subsystem.

Source

pub fn is_dag_error(&self) -> bool

Returns true if this error belongs to DAG management.

Trait Implementations§

Source§

impl Debug for BranchError

Source§

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

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

impl Display for BranchError

Source§

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

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

impl Error for BranchError

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<BranchError> for BranchConfigError

Source§

fn from(source: BranchError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for BranchError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for BranchError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for BranchError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<MigrateError> for BranchError

Source§

fn from(source: MigrateError) -> 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more