gglib_core/paths/
error.rs1use std::path::PathBuf;
7use thiserror::Error;
8
9#[derive(Debug, Error)]
11pub enum PathError {
12 #[error("Cannot determine home directory")]
14 NoHomeDir,
15
16 #[error("Cannot determine system data directory")]
18 NoDataDir,
19
20 #[error("{0} exists but is not a directory")]
22 NotADirectory(PathBuf),
23
24 #[error("Directory {0} does not exist")]
26 DirectoryNotFound(PathBuf),
27
28 #[error("Failed to create directory {path}: {reason}")]
30 CreateFailed { path: PathBuf, reason: String },
31
32 #[error("Directory {path} is not writable: {reason}")]
34 NotWritable { path: PathBuf, reason: String },
35
36 #[error("Path cannot be empty")]
38 EmptyPath,
39
40 #[error("Failed to access env file {path}: {reason}")]
42 EnvFileError { path: PathBuf, reason: String },
43
44 #[error("Cannot determine current directory: {0}")]
46 CurrentDirError(String),
47}