use thiserror::Error;
#[derive(Debug, Error, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum ObjectLogError {
#[error("invalid object key: {0}")]
InvalidObjectKey(String),
#[error("storage unavailable: {0}")]
StorageUnavailable(String),
#[error("byte range out of bounds: {0}")]
RangeOutOfBounds(String),
#[error("missing object: {0}")]
MissingObject(String),
#[error("invalid produce batch: {0}")]
InvalidBatch(String),
#[error("sequencer error: {0}")]
Sequencer(String),
#[error("durable-ops budget exceeded: {0}")]
BudgetExceeded(String),
#[error("invalid configuration: {0}")]
InvalidConfig(String),
}
impl From<std::io::Error> for ObjectLogError {
fn from(value: std::io::Error) -> Self {
Self::StorageUnavailable(value.to_string())
}
}