aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
blob: b4ca3d5fa1bcf149eebeef7ff849345e716132d5 (plain) (blame)
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
/// Error type for this crate
#[derive(thiserror::Error, Debug)]
pub enum Error {
    /// error making pty async
    #[error("error making pty async")]
    AsyncPty(#[source] std::io::Error),

    /// error making pty async
    #[error("error making pty async")]
    AsyncPtyNix(#[source] nix::Error),

    /// error creating pty
    #[error("error creating pty")]
    CreatePty(#[source] nix::Error),

    /// error opening pts at \<path\>
    #[error("error opening pts at {1}")]
    OpenPts(#[source] std::io::Error, std::path::PathBuf),

    /// error setting terminal size
    #[error("error setting terminal size")]
    SetTermSize(#[source] nix::Error),

    /// error spawning subprocess
    #[error("error spawning subprocess")]
    Spawn(#[source] std::io::Error),

    /// error spawning subprocess
    #[error("error spawning subprocess")]
    SpawnNix(#[source] nix::Error),
}

/// Convenience wrapper for `Result`s using [`Error`](Error)
pub type Result<T> = std::result::Result<T, Error>;