Skip to main content

libbrat_workflow/
error.rs

1//! Workflow error types.
2
3use thiserror::Error;
4
5/// Errors that can occur during workflow operations.
6#[derive(Debug, Error)]
7pub enum WorkflowError {
8    /// Workflow file not found.
9    #[error("workflow not found: {0}")]
10    NotFound(String),
11
12    /// Failed to read workflow file.
13    #[error("failed to read workflow: {0}")]
14    ReadError(#[from] std::io::Error),
15
16    /// Failed to parse YAML.
17    #[error("failed to parse workflow YAML: {0}")]
18    ParseError(#[from] serde_yaml::Error),
19
20    /// Workflow validation failed.
21    #[error("workflow validation failed: {0}")]
22    ValidationError(String),
23
24    /// Missing required input.
25    #[error("missing required input: {0}")]
26    MissingInput(String),
27
28    /// Invalid input value.
29    #[error("invalid input '{0}': {1}")]
30    InvalidInput(String, String),
31
32    /// Circular dependency in workflow steps.
33    #[error("circular dependency detected in workflow steps")]
34    CircularDependency,
35
36    /// Unknown step reference in dependency.
37    #[error("unknown step '{0}' referenced in 'needs'")]
38    UnknownStep(String),
39
40    /// Failed to create convoy/task in Grit.
41    #[error("grite error: {0}")]
42    GriteError(#[from] libbrat_grite::GriteError),
43
44    /// Workflow directory not found.
45    #[error("workflow directory not found: {0}")]
46    WorkflowDirNotFound(String),
47}