armature_cron/
error.rs

1//! Error types for cron operations.
2
3use thiserror::Error;
4
5/// Result type for cron operations.
6pub type CronResult<T> = Result<T, CronError>;
7
8/// Cron-specific errors.
9#[derive(Debug, Error)]
10pub enum CronError {
11    /// Invalid cron expression
12    #[error("Invalid cron expression: {0}")]
13    InvalidExpression(String),
14
15    /// Job not found
16    #[error("Job not found: {0}")]
17    JobNotFound(String),
18
19    /// Job already exists
20    #[error("Job already exists: {0}")]
21    JobAlreadyExists(String),
22
23    /// Job execution failed
24    #[error("Job execution failed: {0}")]
25    ExecutionFailed(String),
26
27    /// Scheduler not running
28    #[error("Scheduler not running")]
29    SchedulerNotRunning,
30
31    /// Scheduler already running
32    #[error("Scheduler already running")]
33    SchedulerAlreadyRunning,
34
35    /// Configuration error
36    #[error("Configuration error: {0}")]
37    Config(String),
38
39    /// Generic error
40    #[error("Cron error: {0}")]
41    Other(String),
42}