refactor(git): reporitory errors don't leak implementation

This commit is contained in:
Paul Campbell 2024-05-19 15:01:19 +01:00
parent 155497c97f
commit 70100f6dc5

View file

@ -67,23 +67,23 @@ pub enum Error {
Wait(std::io::Error), Wait(std::io::Error),
Spawn(std::io::Error), Spawn(std::io::Error),
Validation(String), Validation(String),
GixClone(Box<gix::clone::Error>), Clone(String),
GixOpen(Box<gix::open::Error>), Open(String),
GixFetch(Box<gix::clone::fetch::Error>), Fetch(String),
} }
impl std::error::Error for Error {} impl std::error::Error for Error {}
impl From<gix::clone::Error> for Error { impl From<gix::clone::Error> for Error {
fn from(value: gix::clone::Error) -> Self { fn from(value: gix::clone::Error) -> Self {
Self::GixClone(Box::new(value)) Self::Clone(value.to_string())
} }
} }
impl From<gix::open::Error> for Error { impl From<gix::open::Error> for Error {
fn from(value: gix::open::Error) -> Self { fn from(value: gix::open::Error) -> Self {
Self::GixOpen(Box::new(value)) Self::Open(value.to_string())
} }
} }
impl From<gix::clone::fetch::Error> for Error { impl From<gix::clone::fetch::Error> for Error {
fn from(value: gix::clone::fetch::Error) -> Self { fn from(value: gix::clone::fetch::Error) -> Self {
Self::GixFetch(Box::new(value)) Self::Fetch(value.to_string())
} }
} }