feat(JjLib): JjLib implementation
This commit is contained in:
16
src/error.rs
16
src/error.rs
@@ -16,6 +16,10 @@ pub enum Error {
|
||||
JjOperation { context: String },
|
||||
#[error("Repository is locked by another process")]
|
||||
RepositoryLocked,
|
||||
#[error("Could not get current directory")]
|
||||
FailedGettingCurrentDir,
|
||||
#[error("Could not load Jujutsu configuration")]
|
||||
FailedReadingConfig,
|
||||
// Application errors
|
||||
#[error("Operation cancelled by user")]
|
||||
Cancelled,
|
||||
@@ -40,3 +44,15 @@ impl From<CommitMessageError> for Error {
|
||||
Self::InvalidCommitMessage(value.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::io::Error> for Error {
|
||||
fn from(_value: std::io::Error) -> Self {
|
||||
Self::FailedGettingCurrentDir
|
||||
}
|
||||
}
|
||||
|
||||
impl From<jj_lib::config::ConfigGetError> for Error {
|
||||
fn from(_: jj_lib::config::ConfigGetError) -> Self {
|
||||
Self::FailedReadingConfig
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user