aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
blob: 90c6786d3b831891963f7ed632af68c2ebbe5c92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Type for errors returned by this crate.
#[derive(thiserror::Error, Debug)]
pub enum Error {
    /// error reading from stdin
    #[error("error reading from stdin")]
    ReadStdin(#[source] std::io::Error),

    /// error setting terminal mode
    #[error("error setting terminal mode")]
    SetTerminalMode(#[source] nix::Error),

    /// error writing to stdout
    #[error("error writing to stdout")]
    WriteStdout(#[source] std::io::Error),
}

/// Convenience wrapper for a `Result` using `textmode::Error`.
pub type Result<T> = std::result::Result<T, Error>;