use std::{
error::Error,
fmt::Display
};
#[derive(Debug)]
pub enum BevyCssError
{
UnsupportedSelector,
UnsupportedProperty(String),
InvalidPropertyValue(String),
InvalidSelector,
UnexpectedToken(String),
}
impl Error
for BevyCssError
{
}
impl Display
for BevyCssError
{
fn fmt(
&self,
formatter: &mut std::fmt::Formatter<'_>
) -> std::fmt::Result {
match self
{
BevyCssError::UnsupportedSelector => write!(formatter, "Unsupported selector"),
BevyCssError::UnsupportedProperty(prop) => write!(formatter, "Unsupported property: {}", prop),
BevyCssError::InvalidPropertyValue(value) => write!(formatter, "Invalid property value: {}", value),
BevyCssError::InvalidSelector => write!(formatter, "Invalid selector"),
BevyCssError::UnexpectedToken(token) => write!(formatter, "Unexpected token: {}", token),
}
}
}