use thiserror::Error;

#[derive(Error, Debug)]
pub enum DakeraError {
    #[error("Namespace not found: {0}")]
    NamespaceNotFound(String),

    #[error("Vector not found: {0}")]
    VectorNotFound(String),

    #[error("Invalid dimension: expected {expected}, got {actual}")]
    DimensionMismatch { expected: usize, actual: usize },

    #[error("Empty vector")]
    EmptyVector,

    #[error("Storage error: {0}")]
    Storage(String),

    #[error("Invalid request: {0}")]
    InvalidRequest(String),

    #[error("Quota exceeded for namespace '{namespace}': {reason}")]
    QuotaExceeded { namespace: String, reason: String },

    #[error("Service unavailable: {0}")]
    ServiceUnavailable(String),
}

pub type Result<T> = std::result::Result<T, DakeraError>;
