Skip to main content

yarli_cli/yarli-exec/src/
error.rs

1//! Error types for yarli-exec.
2
3use thiserror::Error;
4
5/// Errors from command execution operations.
6#[derive(Debug, Error)]
7pub enum ExecError {
8    /// Failed to spawn the child process.
9    #[error("spawn failed: {0}")]
10    SpawnFailed(#[source] std::io::Error),
11
12    /// I/O error reading process output.
13    #[error("io error: {0}")]
14    Io(#[from] std::io::Error),
15
16    /// Command timed out after the configured duration.
17    #[error("command timed out after {0:?}")]
18    Timeout(std::time::Duration),
19
20    /// Invalid state transition on the command entity.
21    #[error("transition error: {0}")]
22    Transition(#[from] crate::yarli_core::error::TransitionError),
23
24    /// The command was killed (e.g. during shutdown).
25    #[error("command killed: {reason}")]
26    Killed { reason: String },
27
28    /// Journal persistence error.
29    #[error("journal error: {0}")]
30    Journal(String),
31
32    /// HTTP transport error (Overwatch backend).
33    #[error("http error: {0}")]
34    Http(#[from] reqwest::Error),
35
36    /// Backend protocol or payload mismatch.
37    #[error("backend protocol error: {0}")]
38    Protocol(String),
39}