use std::{fmt, error};
#[derive(Debug, Clone)]
pub struct ParseError;
impl fmt::Display for ParseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Unable to parse command")
}
}
impl error::Error for ParseError {
fn description(&self) -> &str {
"Unable to parse command"
}
fn cause(&self) -> Option<&error::Error> {
None
}
}
#[derive(Debug, Clone)]
pub struct StorageError(pub String);
impl fmt::Display for StorageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.0)
}
}
impl error::Error for StorageError {
fn description(&self) -> &str {
self.0.as_ref()
}
fn cause(&self) -> Option<&error::Error> {
None
}
}