1use super::*;
2
3#[derive(Debug)]
4pub enum OutputError {
5 Code(i32),
7 Io(io::Error),
9 Signal(i32),
11 Unknown,
13 Utf8(str::Utf8Error),
15}
16
17impl Display for OutputError {
18 fn fmt(&self, f: &mut Formatter) -> fmt::Result {
19 match *self {
20 Self::Code(code) => write!(f, "Process exited with status code {code}"),
21 Self::Io(ref io_error) => write!(f, "Error executing process: {io_error}"),
22 Self::Signal(signal) => write!(f, "Process terminated by signal {signal}"),
23 Self::Unknown => write!(f, "Process experienced an unknown failure"),
24 Self::Utf8(ref err) => write!(f, "Could not convert process stdout to UTF-8: {err}"),
25 }
26 }
27}