use std::io;
use std::string::FromUtf8Error;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum GrausError {
#[error("GrausDb IO error")]
Io(#[from] io::Error),
#[error("Key not found")]
KeyNotFound,
#[error("{0}")]
Serde(#[from] serde_json::Error),
#[error("Unexpected command type")]
UnexpectedCommandType,
#[error("UTF-8 error: {0}")]
Utf8(#[from] FromUtf8Error),
#[error("{0}")]
StringError(String),
#[error("Predicate not satisfied")]
PredicateNotSatisfied,
}
pub type Result<T> = std::result::Result<T, GrausError>;