ant_node_manager/
error.rs1use 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("Unable to remove a running service {0:?}, stop this service first before removing")]
26 ServiceAlreadyRunning(Vec<String>),
27 #[error("The service(s) is not running: {0:?}")]
28 ServiceNotRunning(Vec<String>),
29 #[error(transparent)]
30 ServiceManagementError(#[from] ant_service_management::Error),
31 #[error("The service status is not as expected. Expected: {expected:?}")]
32 ServiceStatusMismatch {
33 expected: ant_service_management::ServiceStatus,
34 },
35}