summaryrefslogtreecommitdiff
path: root/src/error.rs
blob: 3086204daa5940539d34d5213a8225e9c8eda8b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use thiserror::Error;

/// The Result type used throughout
pub type Result<T, E = Error> = std::result::Result<T, E>;

/// All errors that can be encountered when running
#[derive(Debug, Error)]
pub enum Error {
    #[error("xcb returned screen that doesn't exist")]
    NoSuchScreen,

    #[error("other wm is running")]
    OtherWMRunning,

    #[error("generic xcb error: {0}")]
    Xcb(#[from] xcb::Error),

    #[error("connection error: {0}")]
    Connection(#[from] xcb::ConnError),

    #[error("protocol error: {0}")]
    Protocol(#[from] xcb::ProtocolError),
}