#![allow(clippy::enum_variant_names)]
use thiserror::Error;
pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug, Error)]
pub enum Error {
#[error(transparent)]
Json(#[from] serde_json::Error),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error("The PID of the process was not found after starting it.")]
PidNotFoundAfterStarting,
#[error("The PID of the process was not set.")]
PidNotSet,
#[error(transparent)]
SemverError(#[from] semver::Error),
#[error("Unable to remove a running service {0:?}, stop this service first before removing")]
ServiceAlreadyRunning(Vec<String>),
#[error("The service(s) is not running: {0:?}")]
ServiceNotRunning(Vec<String>),
#[error(transparent)]
ServiceManagementError(#[from] ant_service_management::Error),
#[error("The service status is not as expected. Expected: {expected:?}")]
ServiceStatusMismatch {
expected: ant_service_management::ServiceStatus,
},
}