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

pub type Result<T, E = Error> = std::result::Result<T, E>;

#[derive(Debug, Error)]
pub enum Error {
    #[error("xcb returned screen that doesn't exist")]
    NoSuchScreen,

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

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

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

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