1use fluvio_command::CommandError;
2use std::io::Error as IoError;
3use std::string::FromUtf8Error;
4
5#[derive(thiserror::Error, Debug)]
6pub enum HelmError {
7 #[error(
8 r#"Unable to find 'helm' executable
9 Please make sure helm is installed and in your PATH.
10 See https://helm.sh/docs/intro/install/ for more help"#
11 )]
12 HelmNotInstalled(IoError),
13 #[error("Failed to read helm client version: {0}")]
14 HelmVersionNotFound(String),
15 #[error("Failed to connect to Kubernetes")]
16 FailedToConnect,
17 #[error("Failed to parse helm output as UTF8")]
18 Utf8Error(#[from] FromUtf8Error),
19 #[error("Failed to parse JSON from helm output")]
20 Serde(#[from] serde_json::Error),
21 #[error("Failed to execute a command")]
22 Command(#[from] CommandError),
23}