term_detect/
error.rs

1use std::{env::VarError, io::Error as IoError};
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum DetectionError {
6    #[error("environment var error")]
7    VarError(#[from] VarError),
8    #[error("child process failed")]
9    IoError(#[from] IoError),
10    #[error("the desktop file does not contain Exec key")]
11    DesktopFileError(String),
12    #[error("unsupported desktop")]
13    UnsupportedDesktopError,
14    #[error("failed to parse config file")]
15    IniParseError(String),
16    #[error("terminal not found in desktop config")]
17    DEFindError,
18    #[error("no known terminal found in path")]
19    FindError,
20    #[error("failed to detect terminal")]
21    MetaError(Vec<DetectionError>),
22}
23
24impl From<Vec<DetectionError>> for DetectionError {
25    fn from(value: Vec<DetectionError>) -> Self {
26        Self::MetaError(value)
27    }
28}