pub enum Error {
GitNotFound,
UnsupportedVersion {
found: String,
minimum: String,
},
CommandFailed {
command: String,
exit_code: i32,
stdout: String,
stderr: String,
},
ParseError {
message: String,
},
InvalidConfig {
message: String,
},
NotARepository {
path: String,
},
Io {
message: String,
source: Error,
},
Timeout {
timeout_seconds: u64,
},
Custom {
message: String,
},
}Expand description
Main error type for all git-spawn operations.
Variants§
GitNotFound
Git binary not found in PATH.
UnsupportedVersion
Git version is below the minimum supported.
CommandFailed
A git command exited with a non-zero status.
Fields
ParseError
Failed to parse git output into a typed value.
InvalidConfig
Invalid configuration supplied to a builder.
NotARepository
Operation targeted a path that is not a git repository.
Io
IO error while spawning or reading from a git process.
Timeout
Command exceeded its configured timeout.
Custom
Generic error with a custom message.
Implementations§
Source§impl Error
impl Error
Sourcepub fn command_failed(
command: impl Into<String>,
exit_code: i32,
stdout: impl Into<String>,
stderr: impl Into<String>,
) -> Self
pub fn command_failed( command: impl Into<String>, exit_code: i32, stdout: impl Into<String>, stderr: impl Into<String>, ) -> Self
Create a Error::CommandFailed.
Sourcepub fn parse_error(message: impl Into<String>) -> Self
pub fn parse_error(message: impl Into<String>) -> Self
Create a Error::ParseError.
Sourcepub fn invalid_config(message: impl Into<String>) -> Self
pub fn invalid_config(message: impl Into<String>) -> Self
Create a Error::InvalidConfig.
Sourcepub fn not_a_repository(path: impl Into<String>) -> Self
pub fn not_a_repository(path: impl Into<String>) -> Self
Create a Error::NotARepository.
Sourcepub fn timeout(timeout_seconds: u64) -> Self
pub fn timeout(timeout_seconds: u64) -> Self
Create a Error::Timeout.
Sourcepub fn custom(message: impl Into<String>) -> Self
pub fn custom(message: impl Into<String>) -> Self
Create a Error::Custom.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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