1use std::{io, string::FromUtf16Error, string::FromUtf8Error};
2use thiserror::Error;
3
4#[derive(Debug, Error)]
5#[non_exhaustive]
6pub enum Error {
7 #[error("I/O Error: {0}")]
8 IOError(#[from] io::Error),
9
10 #[error("Invalid UTF-8: {0}")]
11 InvalidUtf8_8(#[from] FromUtf8Error),
12
13 #[error("Invalid UTF-8: {0}")]
14 InvalidUtf8_16(#[from] FromUtf16Error),
15
16 #[cfg(all(unix, not(target_os = "macos")))]
17 #[error("Invalid INI: {0}")]
18 InvalidIni(#[from] ini::ini::Error),
19
20 #[cfg(unix)]
21 #[error("Enquote error: {0}")]
22 Enquote(#[from] enquote::Error),
23
24 #[error("{command} exited with status code {code}")]
25 CommandFailed { command: String, code: i32 },
26
27 #[error("Could not find config directory")]
28 NoConfigDir,
29
30 #[error("No {0} image found")]
31 NoImage(&'static str),
32
33 #[error("Unsupported Desktop")]
34 UnsupportedDesktop,
35}