1#[derive(Debug)]
3#[non_exhaustive]
4pub enum YaraError {
5 IndexOpen(String),
7 IndexBuild(String),
9 Mapping(String),
11 InvalidInput(String),
13}
14
15impl std::fmt::Display for YaraError {
16 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17 match self {
18 Self::IndexOpen(msg) => write!(f, "index open error: {msg}"),
19 Self::IndexBuild(msg) => write!(f, "index build error: {msg}"),
20 Self::Mapping(msg) => write!(f, "mapping error: {msg}"),
21 Self::InvalidInput(msg) => write!(f, "invalid input: {msg}"),
22 }
23 }
24}
25
26impl std::error::Error for YaraError {}