use std::fmt::{Display, Formatter};
#[derive(Debug, Clone)]
pub enum Error {
InvalidArgument,
EventAlreadySigned,
NotFound,
StorageFailure,
InvalidOutcome,
Internal,
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Error::InvalidArgument => write!(f, "Invalid argument given"),
Error::EventAlreadySigned => write!(f, "Event already signed"),
Error::NotFound => write!(f, "Event data not found"),
Error::StorageFailure => write!(f, "Storage failure"),
Error::InvalidOutcome => write!(f, "Invalid outcome"),
Error::Internal => write!(f, "Internal error"),
}
}
}
impl std::error::Error for Error {}