use thiserror::Error;
#[derive(Error, Debug)]
pub enum BatchError {
#[error("Channel closed: the batcher worker has terminated")]
ChannelClosed,
#[error("Channel full: the batcher is under heavy load")]
ChannelFull,
#[error("Flush failed: {0}")]
FlushError(String),
#[error("Serialization error: {0}")]
SerializationError(String),
#[error("Schema validation failed: {0}")]
SchemaError(String),
}
pub type Result<T> = std::result::Result<T, BatchError>;