ricecoder_orchestration/
error.rs

1//! Error types for the orchestration module
2
3use thiserror::Error;
4
5/// Errors that can occur during orchestration operations
6#[derive(Debug, Error)]
7pub enum OrchestrationError {
8    #[error("Project not found: {0}")]
9    ProjectNotFound(String),
10
11    #[error("Circular dependency detected: {0}")]
12    CircularDependency(String),
13
14    #[error("Dependency validation failed: {0}")]
15    DependencyValidationFailed(String),
16
17    #[error("Batch execution failed: {0}")]
18    BatchExecutionFailed(String),
19
20    #[error("Configuration error: {0}")]
21    ConfigurationError(String),
22
23    #[error("Rules validation failed: {0}")]
24    RulesValidationFailed(String),
25
26    #[error("Version constraint violation: {0}")]
27    VersionConstraintViolation(String),
28
29    #[error("Transaction failed: {0}")]
30    TransactionFailed(String),
31
32    #[error("Rollback failed: {0}")]
33    RollbackFailed(String),
34
35    #[error("IO error: {0}")]
36    IoError(#[from] std::io::Error),
37
38    #[error("Path resolution error: {0}")]
39    PathResolutionError(String),
40
41    #[error("Serialization error: {0}")]
42    SerializationError(#[from] serde_json::Error),
43
44    #[error("YAML error: {0}")]
45    YamlError(String),
46}
47
48impl From<serde_yaml::Error> for OrchestrationError {
49    fn from(err: serde_yaml::Error) -> Self {
50        OrchestrationError::YamlError(err.to_string())
51    }
52}
53
54/// Result type for orchestration operations
55pub type Result<T> = std::result::Result<T, OrchestrationError>;