ant_node_manager/
error.rs1#![allow(clippy::enum_variant_names)]
11
12use thiserror::Error;
13
14pub type Result<T, E = Error> = std::result::Result<T, E>;
15
16#[derive(Debug, Error)]
17pub enum Error {
18 #[error(transparent)]
19 Json(#[from] serde_json::Error),
20 #[error(transparent)]
21 Io(#[from] std::io::Error),
22 #[error("The PID of the process was not found after starting it.")]
23 PidNotFoundAfterStarting,
24 #[error("The PID of the process was not set.")]
25 PidNotSet,
26 #[error(transparent)]
27 SemverError(#[from] semver::Error),
28 #[error("Unable to remove a running service {0:?}, stop this service first before removing")]
29 ServiceAlreadyRunning(Vec<String>),
30 #[error("The service(s) is not running: {0:?}")]
31 ServiceNotRunning(Vec<String>),
32 #[error(transparent)]
33 ServiceManagementError(#[from] ant_service_management::Error),
34 #[error("The service status is not as expected. Expected: {expected:?}")]
35 ServiceStatusMismatch {
36 expected: ant_service_management::ServiceStatus,
37 },
38}