Skip to main content

aegon_types/
error.rs

1//! Crate-wide error and result types.
2
3/// Errors that can originate from parsing or constructing domain types.
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    /// A required field was absent in the source data.
7    #[error("missing required field: {0}")]
8    MissingField(&'static str),
9
10    /// A field value did not match the expected format or range.
11    #[error("invalid field '{field}': {reason}")]
12    InvalidField { field: &'static str, reason: String },
13}
14
15/// Convenience alias used throughout the workspace.
16pub type Result<T> = std::result::Result<T, Error>;