ca_rules/error.rs
1//! Errors that can be returned when parsing rule strings.
2
3// use std::fmt::{self, Display, Formatter};
4use displaydoc::Display;
5use thiserror::Error;
6
7/// Errors that can be returned when parsing rule strings.
8#[derive(Clone, Debug, PartialEq, Eq, Error, Display)]
9pub enum ParseRuleError {
10 /// Missing expected {0:?}
11 Missing(char),
12 /// Missing expected number
13 MissingNumber,
14 /// Unexpected {0:?}
15 Unexpected(char),
16 /// Extra unparsed junk at the end of the rule string
17 ExtraJunk,
18 /// Number of states less than 2 in Generations rule
19 GenLessThan2,
20 /// Not a MAP rule
21 NotMapRule,
22 /// Invalid Base64 encoding for MAP rule
23 Base64Error,
24 /// Invalid length for MAP rule
25 InvalidLength,
26 /// Generations number overflow for Generations rule
27 GenOverflow,
28}