Skip to main content

anomalyx_core/
error.rs

1//! Core error type. Detectors and normalizers surface failures here; the CLI
2//! maps these to [`crate::envelope::ExitCode::Error`].
3
4use thiserror::Error;
5
6#[derive(Debug, Error)]
7pub enum AxError {
8    #[error("unsupported or unrecognized input format: {0}")]
9    UnknownFormat(String),
10
11    #[error("failed to parse {format} input: {message}")]
12    Parse { format: String, message: String },
13
14    #[error("io error: {0}")]
15    Io(String),
16
17    #[error("malformed handle: {0}")]
18    BadHandle(String),
19
20    #[error("handle does not resolve against this corpus: {0}")]
21    UnresolvedHandle(String),
22
23    #[error("invalid configuration: {0}")]
24    Config(String),
25}
26
27pub type Result<T> = std::result::Result<T, AxError>;