1use thiserror::Error;
2
3pub type AgentResult<T> = Result<T, AgentError>;
5
6#[derive(Debug, Error)]
8pub enum AgentError {
9 #[error("registry actor is closed")]
10 RegistryClosed,
11 #[error("registry actor failed: {0}")]
12 Actor(String),
13 #[error("invalid job name")]
14 InvalidJobName,
15 #[error("job already exists: {0}")]
16 JobAlreadyExists(String),
17 #[error("job not found: {0}")]
18 JobNotFound(String),
19 #[error("job is already running: {0}")]
20 JobAlreadyRunning(String),
21 #[error("job is not running: {0}")]
22 JobNotRunning(String),
23 #[error("job does not support graceful drain: {0}")]
24 DrainUnsupported(String),
25 #[error("restart limit exceeded for job: {0}")]
26 RestartLimitExceeded(String),
27 #[error(transparent)]
28 Stream(#[from] datum::StreamError),
29}