#[cfg(feature = "experimental")]
use crate::rules::reference::parser::ParserError;
use displaydoc::Display;
use icu_provider::DataError;
#[derive(Display, Debug, Clone, Copy, PartialEq)]
#[non_exhaustive]
pub enum PluralsError {
#[cfg(feature = "experimental")]
#[displaydoc("Parser error: {0}")]
Parser(ParserError),
#[displaydoc("Data provider error: {0}")]
Data(DataError),
}
#[cfg(feature = "std")]
impl std::error::Error for PluralsError {}
#[cfg(feature = "experimental")]
impl From<ParserError> for PluralsError {
fn from(e: ParserError) -> Self {
PluralsError::Parser(e)
}
}
impl From<DataError> for PluralsError {
fn from(e: DataError) -> Self {
PluralsError::Data(e)
}
}