use rustbreak::error::RustbreakError;
pub(crate) use wildland_corex::catlib_service::error::{CatlibError, CatlibResult};
pub(crate) fn to_catlib_error(rb_error: RustbreakError) -> CatlibError {
match rb_error {
RustbreakError::DeSerialization(_) => {
CatlibError::Generic("RustbreakError::DeSerialization".into())
}
RustbreakError::Poison => CatlibError::Generic("RustbreakError::Poison".into()),
RustbreakError::Backend(_) => CatlibError::Generic("RustbreakError::Backend".into()),
RustbreakError::WritePanic => CatlibError::Generic("RustbreakError::WritePanic".into()),
_ => CatlibError::Generic("Unknown Rustbreak error".into()),
}
}