use thiserror::Error;
#[derive(Error, Debug)]
pub enum VectorDBError {
#[error("Collection not found: {0}")]
CollectionNotFound(String),
#[error("Collection already exists: {0}")]
CollectionExists(String),
#[error("Dimension mismatch in collection '{collection}': expected {expected}, got {actual}")]
DimensionMismatch {
collection: String,
expected: usize,
actual: usize,
},
#[error("Storage error: {0}")]
StorageError(String),
#[error("IO error: {0}")]
IoError(#[from] std::io::Error),
#[error("Serialization error: {0}")]
SerializationError(#[from] serde_json::Error),
}
pub type VectorDBResult<T> = Result<T, VectorDBError>;