pub enum GitError {
Io(String),
InvalidObjectId(String),
InvalidObject(String),
InvalidFormat(String),
InvalidPath(String),
Unsupported(String),
NotFound(NotFoundKind),
Transaction(String),
Command(String),
Cli(CliExit, String),
Exit(i32),
}Variants§
Io(String)
InvalidObjectId(String)
InvalidObject(String)
InvalidFormat(String)
InvalidPath(String)
Unsupported(String)
NotFound(NotFoundKind)
Transaction(String)
Command(String)
Cli(CliExit, String)
Typed CLI exit with a user-facing message printed by the binary entrypoint.
Exit(i32)
Legacy explicit exit code; the message (if any) was already printed by the command.
Implementations§
Source§impl GitError
impl GitError
pub fn usage(msg: impl Into<String>) -> Self
pub fn user_error(msg: impl Into<String>) -> Self
pub fn cli_exit(kind: CliExit, msg: impl Into<String>) -> Self
pub fn cli_exit_code(&self) -> i32
pub fn not_found(msg: impl Into<String>) -> Self
pub fn remote_not_found(name: impl Into<String>) -> Self
pub fn object_not_found(oid: ObjectId) -> Self
pub fn object_kind_not_found(oid: ObjectId, kind: MissingObjectKind) -> Self
pub fn object_not_found_in(oid: ObjectId, context: MissingObjectContext) -> Self
pub fn object_kind_not_found_in( oid: ObjectId, kind: MissingObjectKind, context: MissingObjectContext, ) -> Self
pub fn reference_not_found(name: impl Into<String>) -> Self
pub fn repository_not_found(path: impl Into<String>) -> Self
pub fn not_found_kind(&self) -> Option<&NotFoundKind>
Trait Implementations§
impl Eq for GitError
Source§impl Error for GitError
impl Error for GitError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for GitError
Auto Trait Implementations§
impl Freeze for GitError
impl RefUnwindSafe for GitError
impl Send for GitError
impl Sync for GitError
impl Unpin for GitError
impl UnsafeUnpin for GitError
impl UnwindSafe for GitError
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
Mutably borrows from an owned value. Read more