#[doc(hidden)]
#[macro_export]
macro_rules! client_type_error {
($($arg:tt)*) => {
Err($crate::GraphError::ClientTypeError(format!($($arg)*)))
};
}
pub type GraphResult<T> = Result<T, GraphError>;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GraphError {
ClientTypeError(String),
LabelNotFound,
RelationshipTypeNotFound,
PropertyKeyNotFound,
InvalidUtf8,
}
impl std::fmt::Display for GraphError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
GraphError::ClientTypeError(e) => write!(f, "Graph client error: {}", e),
_ => write!(f, "Graph error"),
}
}
}