this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 51 lines 1.2 kB view raw
1use thiserror::Error; 2 3#[derive(Error, Debug)] 4pub enum GigabrainError { 5 #[error("IO error: {0}")] 6 Io(#[from] std::io::Error), 7 8 #[error("Storage error: {0}")] 9 Storage(String), 10 11 #[error("Transaction error: {0}")] 12 Transaction(String), 13 14 #[error("Query error: {0}")] 15 Query(String), 16 17 #[error("Index error: {0}")] 18 Index(String), 19 20 #[error("Node not found: {0:?}")] 21 NodeNotFound(crate::NodeId), 22 23 #[error("Relationship not found: {0:?}")] 24 RelationshipNotFound(crate::RelationshipId), 25 26 #[error("Property not found: {0}")] 27 PropertyNotFound(String), 28 29 #[error("Cypher parse error: {0}")] 30 CypherParse(String), 31 32 #[error("Distributed operation error: {0}")] 33 Distributed(String), 34 35 #[error("Algorithm error: {0}")] 36 Algorithm(String), 37 38 #[error("Serialization error: {0}")] 39 Serialization(#[from] bincode::Error), 40 41 #[error("Validation error: {0}")] 42 ValidationError(String), 43} 44 45impl From<crate::index::types::IndexError> for GigabrainError { 46 fn from(err: crate::index::types::IndexError) -> Self { 47 GigabrainError::Index(err.to_string()) 48 } 49} 50 51pub type Result<T> = std::result::Result<T, GigabrainError>;