tokio_pty_process_stream/
error.rs

1/// Errors returned by the process stream.
2#[derive(Debug, snafu::Snafu)]
3#[snafu(visibility(pub))]
4pub enum Error {
5    /// failed to open a pty
6    #[snafu(display("failed to open a pty: {}", source))]
7    OpenPty { source: std::io::Error },
8
9    /// failed to poll for process exit
10    #[snafu(display("failed to poll for process exit: {}", source))]
11    ProcessExitPoll { source: std::io::Error },
12
13    /// failed to read from pty
14    #[snafu(display("failed to read from pty: {}", source))]
15    ReadPty { source: std::io::Error },
16
17    /// failed to read from terminal
18    #[snafu(display("failed to read from terminal: {}", source))]
19    ReadTerminal { source: std::io::Error },
20
21    /// failed to resize pty
22    #[snafu(display("failed to resize pty: {}", source))]
23    ResizePty { source: std::io::Error },
24
25    #[snafu(display("failed to poll for terminal resizing: {}", source))]
26    Resize {
27        source: tokio_terminal_resize::Error,
28    },
29
30    /// failed to spawn process
31    #[snafu(display("failed to spawn process for `{}`: {}", cmd, source))]
32    SpawnProcess { cmd: String, source: std::io::Error },
33
34    /// failed to write to pty
35    #[snafu(display("failed to write to pty: {}", source))]
36    WritePty { source: std::io::Error },
37}