pub enum Git2DBError {
Show 18 variants
GitOperation {
class: ErrorClass,
code: ErrorCode,
message: String,
recoverable: bool,
},
Repository {
path: PathBuf,
message: String,
},
Submodule {
name: String,
message: String,
},
Reference {
reference: String,
message: String,
},
Authentication {
url: String,
message: String,
},
Network {
message: String,
},
Configuration {
message: String,
},
InvalidPath {
path: PathBuf,
message: String,
},
InvalidRepository {
name: String,
message: String,
},
WorktreeExists {
path: PathBuf,
},
Cancelled {
operation: String,
},
InvalidOperation {
message: String,
},
Internal {
message: String,
},
MergeConflictReport(ConflictReport),
Lfs {
kind: LfsErrorKind,
message: String,
},
Io(Error),
Json(Error),
External(Error),
}Expand description
Comprehensive error types for git2db operations
Variants§
GitOperation
Git operation errors with enhanced classification
Repository
Repository access errors
Submodule
Submodule operation errors
Reference
Reference resolution errors
Authentication
Authentication errors
Network
Network operation errors
Configuration
Configuration errors
InvalidPath
Path validation errors
InvalidRepository
Repository validation errors
WorktreeExists
Worktree already exists at path
Cancelled
Operation cancelled by user
InvalidOperation
Invalid operation (e.g., nothing to commit, empty merge)
Internal
Internal library errors
MergeConflictReport(ConflictReport)
Structured merge-conflict report from in-memory candidate composition (issue #1428). Carries path + side detail rather than a string-only message, so callers can render or programmatically handle conflicts.
Lfs
LFS operation errors
Io(Error)
IO errors
Json(Error)
JSON serialization errors
External(Error)
Generic errors from dependencies
Implementations§
Source§impl Git2DBError
impl Git2DBError
Sourcepub fn class(&self) -> Option<ErrorClass>
pub fn class(&self) -> Option<ErrorClass>
Get error class if this is a GitOperation error
Sourcepub fn from_git_error(err: Error) -> Self
pub fn from_git_error(err: Error) -> Self
Create a git operation error from git2::Error
Sourcepub fn repository<P: Into<PathBuf>, S: Into<String>>(
path: P,
message: S,
) -> Self
pub fn repository<P: Into<PathBuf>, S: Into<String>>( path: P, message: S, ) -> Self
Create a repository error
Sourcepub fn submodule<N: Into<String>, M: Into<String>>(name: N, message: M) -> Self
pub fn submodule<N: Into<String>, M: Into<String>>(name: N, message: M) -> Self
Create a submodule error
Sourcepub fn reference<R: Into<String>, M: Into<String>>(
reference: R,
message: M,
) -> Self
pub fn reference<R: Into<String>, M: Into<String>>( reference: R, message: M, ) -> Self
Create a reference error
Sourcepub fn authentication<U: Into<String>, M: Into<String>>(
url: U,
message: M,
) -> Self
pub fn authentication<U: Into<String>, M: Into<String>>( url: U, message: M, ) -> Self
Create an authentication error
Sourcepub fn configuration<S: Into<String>>(message: S) -> Self
pub fn configuration<S: Into<String>>(message: S) -> Self
Create a configuration error
Sourcepub fn invalid_path<P: Into<PathBuf>, M: Into<String>>(
path: P,
message: M,
) -> Self
pub fn invalid_path<P: Into<PathBuf>, M: Into<String>>( path: P, message: M, ) -> Self
Create an invalid path error
Sourcepub fn invalid_repository<N: Into<String>, M: Into<String>>(
name: N,
message: M,
) -> Self
pub fn invalid_repository<N: Into<String>, M: Into<String>>( name: N, message: M, ) -> Self
Create an invalid repository error
Sourcepub fn worktree_exists<P: Into<PathBuf>>(path: P) -> Self
pub fn worktree_exists<P: Into<PathBuf>>(path: P) -> Self
Create a worktree exists error
Sourcepub fn is_worktree_exists(&self) -> bool
pub fn is_worktree_exists(&self) -> bool
Check if this error is a worktree exists error
Sourcepub fn invalid_operation<S: Into<String>>(message: S) -> Self
pub fn invalid_operation<S: Into<String>>(message: S) -> Self
Create an invalid operation error
Sourcepub fn lfs<S: Into<String>>(kind: LfsErrorKind, message: S) -> Self
pub fn lfs<S: Into<String>>(kind: LfsErrorKind, message: S) -> Self
Create an LFS error with specific kind
Sourcepub fn lfs_kind(&self) -> Option<LfsErrorKind>
pub fn lfs_kind(&self) -> Option<LfsErrorKind>
Get LFS error kind if this is an LFS error
Sourcepub fn merge_conflict<S: Into<String>>(message: S) -> Self
pub fn merge_conflict<S: Into<String>>(message: S) -> Self
Create a merge conflict error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if the error is recoverable
Trait Implementations§
Source§impl Debug for Git2DBError
impl Debug for Git2DBError
Source§impl Display for Git2DBError
impl Display for Git2DBError
Source§impl Error for Git2DBError
impl Error for Git2DBError
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()
Source§impl From<ConflictReport> for Git2DBError
impl From<ConflictReport> for Git2DBError
Source§fn from(source: ConflictReport) -> Self
fn from(source: ConflictReport) -> Self
Source§impl From<Error> for Git2DBError
impl From<Error> for Git2DBError
Source§impl From<Error> for Git2DBError
impl From<Error> for Git2DBError
Source§impl From<Error> for Git2DBError
impl From<Error> for Git2DBError
Source§impl From<Error> for Git2DBError
impl From<Error> for Git2DBError
Source§impl From<Git2DBError> for DriverError
impl From<Git2DBError> for DriverError
Source§fn from(source: Git2DBError) -> Self
fn from(source: Git2DBError) -> Self
Auto Trait Implementations§
impl Freeze for Git2DBError
impl !RefUnwindSafe for Git2DBError
impl Send for Git2DBError
impl Sync for Git2DBError
impl Unpin for Git2DBError
impl UnsafeUnpin for Git2DBError
impl !UnwindSafe for Git2DBError
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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