use thiserror::Error;
#[derive(Debug, Error)]
pub enum DirectoryConfigError {
#[error("invalid table name: {0}")]
InvalidTableName(String),
#[error("store not started")]
NotStarted,
#[error("store already running")]
AlreadyRunning,
#[error("table not found: {0}")]
TableNotFound(String),
#[error("key '{key}' not found in table '{table}'")]
KeyNotFound { table: String, key: String },
#[error("table already exists: {0}")]
TableExists(String),
#[error("store is read-only")]
ReadOnly,
#[error("YAML parse error in '{file}': {message}")]
ParseError { file: String, message: String },
#[error("YAML serialisation error: {0}")]
SerializationError(String),
#[error("I/O error: {0}")]
IoError(#[from] std::io::Error),
#[error("directory not found: {0}")]
DirectoryNotFound(String),
#[cfg(feature = "directory-config-git")]
#[error("git error: {0}")]
GitError(String),
#[error("not a git repository")]
NotGitRepo,
}
pub type DirectoryConfigResult<T> = Result<T, DirectoryConfigError>;