use {
log::*,
thiserror::Error,
};
#[derive(Debug, Error)]
pub enum Error {
#[error("I/O: {0}")]
Io(std::io::Error),
#[error("Row not found")]
RowNotFound,
#[error("Row write failed")]
RowWriteFailed,
#[error("Row delete failed")]
RowDeleteFailed,
#[error("Object not found: {0}")]
ObjectNotFound(String),
#[error("Object is corrupt: {0}")]
ObjectCorrupt(String),
#[error("Timeout")]
Timeout,
#[error("Thrift")]
Thrift(thrift::Error),
}
impl From<std::io::Error> for Error {
fn from(err: std::io::Error) -> Self {
Self::Io(err)
}
}
impl From<thrift::Error> for Error {
fn from(err: thrift::Error) -> Self {
Self::Thrift(err)
}
}