1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use derive_more::Display;
use std::error::Error;
#[derive(Debug, Display, Copy, Clone)]
pub enum UECOError {
#[display(fmt = "pipe() failed with error code {}", errno)]
PipeFailed{errno: i32},
#[display(fmt = "dup2() failed with error code {}", errno)]
Dup2Failed{errno: i32},
#[display(fmt = "execvp() failed with error code {}", errno)]
ExecvpFailed{errno: i32},
#[display(fmt = "waitpid() failed with error code {}", errno)]
WaitpidFailed{errno: i32},
#[display(fmt = "read() failed with error code {}", errno)]
ReadFailed{errno: i32},
#[display(fmt = "fork() failed with error code {}", errno)]
ForkFailed{errno: i32},
#[display(fmt = "close() failed with error code {}", errno)]
CloseFailed{errno: i32},
#[display(fmt = "The pipe is not yet marked as read end.")]
PipeNotMarkedAsReadEnd,
#[display(fmt = "The child was already dispatched/started.")]
ChildAlreadyDispatched,
Unknown,
}
impl Error for UECOError {}