1use thiserror::Error;
10
11pub type Result<T, E = Error> = std::result::Result<T, E>;
12
13#[derive(Debug, Error)]
14pub enum Error {
15 #[error(transparent)]
16 Json(#[from] serde_json::Error),
17 #[error(transparent)]
18 Io(#[from] std::io::Error),
19 #[error("The PID of the process was not found after starting it.")]
20 PidNotFoundAfterStarting,
21 #[error("The PID of the process was not set.")]
22 PidNotSet,
23 #[error(transparent)]
24 SemverError(#[from] semver::Error),
25 #[error("The service(s) is already running: {0:?}")]
26 ServiceAlreadyRunning(Vec<String>),
27 #[error("The service(s) is not running: {0:?}")]
28 ServiceNotRunning(Vec<String>),
29 #[error(transparent)]
30 ServiceManagementError(#[from] sn_service_management::Error),
31 #[error("The service status is not as expected. Expected: {expected:?}")]
32 ServiceStatusMismatch {
33 expected: sn_service_management::ServiceStatus,
34 },
35}