37 lines
936 B
Rust
37 lines
936 B
Rust
// src/executors/error.rs
|
|
use std::io;
|
|
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum ExecutionError {
|
|
#[error("I/O error: {0}")]
|
|
IoError(String),
|
|
|
|
#[error("YAML parse error: {0}")]
|
|
YamlParseError(String),
|
|
|
|
#[error("Command execution error: {0}")]
|
|
CommandExecutionError(String),
|
|
|
|
#[error("Unsupported platform: {0}")]
|
|
UnsupportedPlatform(String),
|
|
|
|
#[error("Template error: {0}")]
|
|
TemplateError(#[from] crate::services::template_engine::TemplateError),
|
|
|
|
#[error("Environment error: {0}")]
|
|
EnvironmentError(#[from] crate::services::environment_manager::EnvironmentError),
|
|
}
|
|
|
|
impl From<io::Error> for ExecutionError {
|
|
fn from(error: io::Error) -> Self {
|
|
ExecutionError::IoError(error.to_string())
|
|
}
|
|
}
|
|
|
|
impl From<serde_yaml::Error> for ExecutionError {
|
|
fn from(error: serde_yaml::Error) -> Self {
|
|
ExecutionError::YamlParseError(error.to_string())
|
|
}
|
|
}
|