1use std::io::Error;
2use std::path::PathBuf;
3
4use crate::implement_from_for_enum;
5
6#[derive(Debug)]
7pub enum InstallationError {
8 BinaryIsNotExecutable(PathBuf),
9 CommandError(Error),
10 FailedToRetrieveAPIVersion,
11 #[cfg(target_family = "windows")]
12 FailedToRetrieveArch,
13}
14
15#[derive(Debug)]
16pub enum DiscoveryError {
17 FailedToReadDirectory(Error),
18 InstallationError(InstallationError),
19 #[cfg(windows)]
20 FailedToLocateSystemDrive,
21}
22
23implement_from_for_enum!(Error, InstallationError, CommandError);
24implement_from_for_enum!(Error, DiscoveryError, FailedToReadDirectory);
25implement_from_for_enum!(InstallationError, DiscoveryError, InstallationError);