use thiserror::Error;
#[derive(Debug, Error)]
pub enum WalError {
#[error("WAL capacity exhausted for source '{0}'")]
CapacityExhausted(String),
#[error("Position {requested} unavailable for source '{source_id}' (oldest available: {oldest_available:?})")]
PositionUnavailable {
source_id: String,
requested: u64,
oldest_available: Option<u64>,
},
#[error("Source '{0}' is not registered with the WAL provider")]
SourceNotRegistered(String),
#[error("Source '{0}' is already registered with a different config")]
SourceAlreadyRegistered(String),
#[error("Invalid source_id '{0}': {1}")]
InvalidSourceId(String, String),
#[error("Invalid event: {0}")]
InvalidEvent(String),
#[error("Invalid configuration: {0}")]
InvalidConfig(String),
#[error("Storage error: {0}")]
StorageError(String),
#[error("Serialization error: {0}")]
SerializationError(String),
}