diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-10-27 13:12:57 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-10-27 13:12:57 -0400 |
commit | e74e5f1d2a1e091af214e39166b6a17d9052325c (patch) | |
tree | 4c894a3eb6b1cf991e6cfaf9938b1fc56d559157 /src/error.rs | |
parent | ea4e8883574502ff890a94932d7a9d20055aed22 (diff) | |
download | tokio-pty-process-stream-e74e5f1d2a1e091af214e39166b6a17d9052325c.tar.gz tokio-pty-process-stream-e74e5f1d2a1e091af214e39166b6a17d9052325c.zip |
split into modules
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 0000000..c8fc902 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,32 @@ +/// Errors returned by the process stream. +#[derive(Debug, snafu::Snafu)] +#[snafu(visibility(pub))] +pub enum Error { + /// failed to open a pty + #[snafu(display("failed to open a pty: {}", source))] + OpenPty { source: std::io::Error }, + + /// failed to poll for process exit + #[snafu(display("failed to poll for process exit: {}", source))] + ProcessExitPoll { source: std::io::Error }, + + /// failed to read from pty + #[snafu(display("failed to read from pty: {}", source))] + ReadPty { source: std::io::Error }, + + /// failed to read from terminal + #[snafu(display("failed to read from terminal: {}", source))] + ReadTerminal { source: std::io::Error }, + + /// failed to resize pty + #[snafu(display("failed to resize pty: {}", source))] + ResizePty { source: std::io::Error }, + + /// failed to spawn process + #[snafu(display("failed to spawn process for `{}`: {}", cmd, source))] + SpawnProcess { cmd: String, source: std::io::Error }, + + /// failed to write to pty + #[snafu(display("failed to write to pty: {}", source))] + WritePty { source: std::io::Error }, +} |