1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::io::Error;
use std::path::PathBuf;

use crate::implement_from_for_enum;

#[derive(Debug)]
pub enum InstallationError {
    BinaryIsNotExecutable(PathBuf),
    CommandError(Error),
    FailedToRetrieveAPIVersion,
}

#[derive(Debug)]
pub enum DiscoveryError {
    FailedToReadDirectory(Error),
    InstallationError(InstallationError),
    #[cfg(windows)]
    FailedToLocateSystemDrive,
}

implement_from_for_enum!(Error, InstallationError, CommandError);
implement_from_for_enum!(Error, DiscoveryError, FailedToReadDirectory);
implement_from_for_enum!(InstallationError, DiscoveryError, InstallationError);