1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, ShimError>;
5
6#[derive(Error, Debug)]
8pub enum ShimError {
9 #[error("IO error: {0}")]
10 Io(#[from] std::io::Error),
11
12 #[error("TOML parsing error: {0}")]
13 TomlParse(#[from] toml::de::Error),
14
15 #[error("TOML serialization error: {0}")]
16 TomlSerialize(#[from] toml::ser::Error),
17
18 #[error("Environment variable expansion error: {0}")]
19 EnvExpansion(String),
20
21 #[error("Shim configuration error: {0}")]
22 Config(String),
23
24 #[error("Executable not found: {0}")]
25 ExecutableNotFound(String),
26
27 #[error("Process execution error: {0}")]
28 ProcessExecution(String),
29
30 #[error("Invalid shim file: {0}")]
31 InvalidShimFile(String),
32
33 #[error("Shim not found: {0}")]
34 ShimNotFound(String),
35
36 #[error("Permission denied: {0}")]
37 PermissionDenied(String),
38
39 #[error("Template processing error: {0}")]
40 TemplateError(String),
41
42 #[error("Download error: {0}")]
43 Download(#[from] anyhow::Error),
44}