use std::fmt::{Display, Formatter};
#[derive(Debug, Clone)]
pub enum Error {
#[deprecated(since = "1.0.9")]
InvalidArgument,
InvalidEventId,
InvalidOutcomes,
InvalidBase,
InvalidNumberOfDigits,
InvalidNonces,
EventAlreadySigned,
NotFound,
StorageFailure,
InvalidOutcome,
InvalidEventDescriptor,
InvalidAnnouncement,
Internal,
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
#[allow(deprecated)]
Error::InvalidArgument => write!(f, "Invalid argument given"),
Error::InvalidEventId => write!(f, "Invalid event ID given"),
Error::InvalidOutcomes => write!(f, "Invalid outcomes given"),
Error::InvalidBase => write!(f, "Invalid base given"),
Error::InvalidNumberOfDigits => write!(f, "Invalid number of digits given"),
Error::InvalidNonces => write!(f, "Invalid nonces 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::InvalidEventDescriptor => write!(f, "Invalid event descriptor"),
Error::InvalidAnnouncement => write!(f, "Invalid announcement"),
Error::Internal => write!(f, "Internal error"),
}
}
}
impl std::error::Error for Error {}