1use std::io;
2use std::string::FromUtf8Error;
3use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum GrausError {
8 #[error("GrausDb IO error")]
10 Io(#[from] io::Error),
11 #[error("Key not found")]
13 KeyNotFound,
14 #[error("{0}")]
16 Serde(#[from] serde_json::Error),
17 #[error("Unexpected command type")]
20 UnexpectedCommandType,
21 #[error("UTF-8 error: {0}")]
23 Utf8(#[from] FromUtf8Error),
24 #[error("{0}")]
26 StringError(String),
27 #[error("Predicate not satisfied")]
29 PredicateNotSatisfied,
30}
31
32pub type Result<T> = std::result::Result<T, GrausError>;