use redis::RedisError;
#[derive(Debug)]
pub enum RedisGraphError {
RedisError(RedisError),
ServerTypeError(String),
ClientTypeError(String),
LabelNotFound,
RelationshipTypeNotFound,
PropertyKeyNotFound,
InvalidUtf8,
}
impl From<RedisError> for RedisGraphError {
fn from(error: RedisError) -> RedisGraphError {
RedisGraphError::RedisError(error)
}
}
pub type RedisGraphResult<T> = Result<T, RedisGraphError>;
#[doc(hidden)]
#[macro_export]
macro_rules! client_type_error {
($($arg:tt)*) => {
Err($crate::RedisGraphError::ClientTypeError(format!($($arg)*)))
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! server_type_error {
($($arg:tt)*) => {
Err($crate::RedisGraphError::ServerTypeError(format!($($arg)*)))
};
}