error.rs (1188B)
1 use thiserror::Error; 2 3 use std::path::PathBuf; 4 5 use crate::{RadrootsPathProfile, RadrootsPlatform}; 6 7 #[derive(Debug, Error, Clone, PartialEq, Eq)] 8 pub enum RadrootsRuntimePathsError { 9 #[error("interactive_user on {platform} requires a home directory")] 10 MissingHomeDir { platform: RadrootsPlatform }, 11 12 #[error("interactive_user on windows requires APPDATA and LOCALAPPDATA roots")] 13 MissingWindowsUserDirs, 14 15 #[error("interactive_user on linux requires XDG_RUNTIME_DIR")] 16 MissingXdgRuntimeDir, 17 18 #[error("interactive_user on {platform} requires HOME to be an absolute path")] 19 InvalidHomeDir { platform: RadrootsPlatform }, 20 21 #[error("repo_local requires an explicit repo-local base root")] 22 MissingRepoLocalRoot, 23 24 #[error("repo_local base root must be an absolute non-root path without parent traversal")] 25 InvalidRepoLocalRoot, 26 27 #[error("{profile} is not supported on {platform}")] 28 UnsupportedProfilePlatform { 29 profile: RadrootsPathProfile, 30 platform: RadrootsPlatform, 31 }, 32 33 #[error("shared accounts data root `{path:?}` has no parent shared data root")] 34 SharedAccountsDataRootMissingParent { path: PathBuf }, 35 }