pub enum RuleError {
LoadError(String),
InvalidRule(String),
PatternError(PatternError),
YamlError(Error),
IoError(Error),
DuplicateBuiltinRule {
id: String,
first: String,
second: String,
},
DuplicateUserRule {
id: String,
path: String,
},
ChecksumMismatch {
path: String,
expected: String,
actual: String,
},
MissingChecksum {
path: String,
},
}Expand description
Error type for rule operations
Encapsulates errors that can occur during rule loading, compilation, and evaluation.
Variants§
LoadError(String)
Failed to load rules from a file or directory
InvalidRule(String)
Rule configuration is invalid
PatternError(PatternError)
Failed to compile a pattern through the matcher port
YamlError(Error)
Failed to parse YAML rule file
IoError(Error)
I/O error during file operations
DuplicateBuiltinRule
Two embedded built-in rule packs define the same rule id with divergent content. This is always a developer bug in the source YAML and must not be silently deduplicated at runtime.
DuplicateUserRule
A user-supplied rule pack declared a rule id that collides with an already-loaded rule. Only surfaced when strict mode is enabled.
ChecksumMismatch
External rule pack body’s SHA-256 digest does not match the value
recorded in the <pack>.sha256 sidecar. The pack is rejected to
prevent silently loading tampered rules.
MissingChecksum
External rule pack has no <pack>.sha256 sidecar and the engine is
running with ChecksumPolicy::Required. Operators who want to load
unsigned packs (development, ad-hoc tooling) can opt out via
set_checksum_policy(ChecksumPolicy::Lenient) or
ChecksumPolicy::WarnOnMissing.
Trait Implementations§
Source§impl Error for RuleError
impl Error for RuleError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()