hyperi_rustlib/directory_config/
error.rs1use thiserror::Error;
10
11#[derive(Debug, Error)]
13pub enum DirectoryConfigError {
14 #[error("invalid table name: {0}")]
16 InvalidTableName(String),
17
18 #[error("store not started")]
20 NotStarted,
21
22 #[error("store already running")]
24 AlreadyRunning,
25
26 #[error("table not found: {0}")]
28 TableNotFound(String),
29
30 #[error("key '{key}' not found in table '{table}'")]
32 KeyNotFound { table: String, key: String },
33
34 #[error("table already exists: {0}")]
36 TableExists(String),
37
38 #[error("store is read-only")]
40 ReadOnly,
41
42 #[error("YAML parse error in '{file}': {message}")]
44 ParseError { file: String, message: String },
45
46 #[error("YAML serialisation error: {0}")]
48 SerializationError(String),
49
50 #[error("I/O error: {0}")]
52 IoError(#[from] std::io::Error),
53
54 #[error("directory not found: {0}")]
56 DirectoryNotFound(String),
57
58 #[cfg(feature = "directory-config-git")]
60 #[error("git error: {0}")]
61 GitError(String),
62
63 #[error("not a git repository")]
65 NotGitRepo,
66}
67
68pub type DirectoryConfigResult<T> = Result<T, DirectoryConfigError>;