1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum EvalError {
8 #[error("invalid regex pattern: {0}")]
10 InvalidRegex(#[from] regex::Error),
11
12 #[error("invalid CIDR: {0}")]
14 InvalidCidr(#[from] ipnet::AddrParseError),
15
16 #[error("base64 encoding error: {0}")]
18 Base64(String),
19
20 #[error("unknown detection identifier: {0}")]
22 UnknownDetection(String),
23
24 #[error("invalid modifier combination: {0}")]
26 InvalidModifiers(String),
27
28 #[error("incompatible value for modifier: {0}")]
30 IncompatibleValue(String),
31
32 #[error("expected numeric value: {0}")]
34 ExpectedNumeric(String),
35
36 #[error("parser error: {0}")]
38 Parser(#[from] rsigma_parser::SigmaParserError),
39
40 #[error("correlation error: {0}")]
42 CorrelationError(String),
43
44 #[error("timestamp parse error: {0}")]
46 TimestampParse(String),
47
48 #[error("unknown rule reference: {0}")]
50 UnknownRuleRef(String),
51
52 #[error("correlation cycle detected: {0}")]
54 CorrelationCycle(String),
55}
56
57pub type Result<T> = std::result::Result<T, EvalError>;