1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum TaskFlowError {
5 #[error("Task execution failed: {0}")]
6 ExecutionError(String),
7
8 #[error("Task not found: {0}")]
9 TaskNotFound(String),
10
11 #[error("Scheduler error: {0}")]
12 SchedulerError(String),
13
14 #[error("Storage error: {0}")]
15 StorageError(String),
16
17 #[error("Serialization error: {0}")]
18 SerializationError(#[from] serde_json::Error),
19
20 #[error("HTTP error: {0}")]
21 HttpError(#[from] reqwest::Error),
22
23 #[error("Invalid task configuration: {0}")]
24 InvalidConfiguration(String),
25
26 #[error("Timeout error: task execution exceeded time limit")]
27 TimeoutError,
28
29 #[error("Retry limit exceeded for task: {0}")]
30 RetryLimitExceeded(String),
31
32 #[error("Unsupported feature: {0}")]
33 UnsupportedFeature(String),
34
35 #[error("Configuration error: {0}")]
36 ConfigError(String),
37}
38
39pub type Result<T> = std::result::Result<T, TaskFlowError>;