stix_matcher/error.rs
1//! Error type for the matcher.
2
3use thiserror::Error;
4
5/// Errors produced while matching a pattern against observations.
6#[derive(Debug, Clone, PartialEq, Eq, Error)]
7pub enum MatchError {
8 /// A pattern feature is parsed but not yet supported by the matcher
9 /// (e.g. `FOLLOWEDBY` sequencing or temporal qualifiers).
10 #[error("unsupported pattern feature: {0}")]
11 Unsupported(String),
12}
13
14#[cfg(test)]
15mod tests {
16 use super::*;
17
18 #[test]
19 fn unsupported_displays_feature() {
20 let e = MatchError::Unsupported("FOLLOWEDBY".to_string());
21 assert!(format!("{e}").contains("FOLLOWEDBY"));
22 }
23}