Skip to main content

laddu_data/
error.rs

1use crate::Name;
2use thiserror::Error;
3
4/// Result type for event-data operations.
5pub type LadduDataResult<T> = Result<T, LadduDataError>;
6
7/// Errors produced by schemas, event sources, sinks, and datasets.
8#[derive(Clone, Error, Debug)]
9pub enum LadduDataError {
10    /// The requested operation is not supported.
11    #[error("Unsupported: {0}")]
12    Unsupported(&'static str),
13    /// An argument failed validation.
14    #[error("Invalid Argument: {0}")]
15    InvalidArgument(&'static str),
16    /// A required physical or logical column was absent.
17    #[error("Missing Column: {0}")]
18    MissingColumn(Name),
19    /// A schema was invalid or incompatible.
20    #[error("Schema Error: {0}")]
21    Schema(String),
22    /// An event source failed.
23    #[error("Source Error: {0}")]
24    Source(String),
25    /// An event sink failed.
26    #[error("Sink Error: {0}")]
27    Sink(String),
28}