Skip to main content

perl_subprocess_runtime/
error.rs

1use std::fmt;
2
3/// Error type for subprocess execution failures
4#[derive(Debug, Clone)]
5pub struct SubprocessError {
6    /// Human-readable error message
7    pub message: String,
8}
9
10impl SubprocessError {
11    /// Create a new subprocess error with the given message
12    pub fn new(message: impl Into<String>) -> Self {
13        Self { message: message.into() }
14    }
15}
16
17impl fmt::Display for SubprocessError {
18    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19        write!(f, "{}", self.message)
20    }
21}
22
23impl std::error::Error for SubprocessError {}