use thiserror::Error;
pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug, Error)]
#[allow(missing_docs)]
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("The service(s) is already running: {0:?}")]
ServiceAlreadyRunning(Vec<String>),
#[error("The service(s) is not running: {0:?}")]
ServiceNotRunning(Vec<String>),
#[error(transparent)]
ServiceManagementError(#[from] sn_service_management::Error),
#[error("The service status is not as expected. Expected: {expected:?}")]
ServiceStatusMismatch {
expected: sn_service_management::ServiceStatus,
},
}