#![allow(clippy::module_name_repetitions)]
use thiserror::Error;
use crate::{parser::ParseError, validator::ValidationError};
#[derive(Error, Debug, Clone, PartialEq)]
pub enum RRuleError {
#[error("RRule parsing error: {0}")]
ParserError(#[from] ParseError),
#[error("RRule validation error: {0}")]
ValidationError(#[from] ValidationError),
#[error("RRule iterator error: {0}")]
IterError(String),
}
impl RRuleError {
pub fn new_iter_err<S: AsRef<str>>(msg: S) -> Self {
Self::IterError(msg.as_ref().to_owned())
}
}