1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum Error {
5 #[error("storage: {0}")]
6 Storage(#[from] heed::Error),
7
8 #[error("encode: {0}")]
9 Encode(#[from] rmp_serde::encode::Error),
10
11 #[error("decode: {0}")]
12 Decode(#[from] rmp_serde::decode::Error),
13
14 #[error("node {0} not found")]
15 NodeNotFound(u64),
16
17 #[error("edge {0} not found")]
18 EdgeNotFound(u64),
19
20 #[error("corrupt storage: {0}")]
21 Corrupt(&'static str),
22
23 #[error("invalid argument: {0}")]
24 InvalidArgument(String),
25
26 #[error("io: {0}")]
27 Io(#[from] std::io::Error),
28
29 #[error("vector index: {0}")]
30 Vector(String),
31
32 #[error("graphblas: {0}")]
33 GraphBLAS(String),
34
35 #[error(
36 "unique constraint violation: node/edge with label/type {0} already has property '{1}' with value {2}"
37 )]
38 UniqueConstraintViolation(String, String, String),
39
40 #[error(
41 "required constraint violation: node/edge with label/type {0} is missing required property '{1}'"
42 )]
43 RequiredConstraintViolation(String, String),
44}