use thiserror::Error;
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum QmdError {
#[error("Database error: {0}")]
Database(#[from] rusqlite::Error),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("YAML error: {0}")]
Yaml(#[from] serde_yaml::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("Collection not found: {0}")]
CollectionNotFound(String),
#[error("Document not found: {0}")]
DocumentNotFound(String),
#[error("Invalid path: {0}")]
InvalidPath(String),
#[error("Configuration error: {0}")]
Config(String),
#[error("{0}")]
General(String),
}
pub type Result<T> = std::result::Result<T, QmdError>;