2021-02-11 22:35:53 +01:00
|
|
|
use x11rb::errors::{ConnectError, ConnectionError, ReplyError};
|
|
|
|
|
use x11rb::protocol::xproto::Atom;
|
2019-12-19 05:47:36 +01:00
|
|
|
|
2021-03-06 04:34:02 +01:00
|
|
|
use std::sync::mpsc;
|
|
|
|
|
|
2019-12-19 05:47:36 +01:00
|
|
|
#[must_use]
|
2021-02-11 22:35:53 +01:00
|
|
|
#[derive(Debug, thiserror::Error)]
|
2019-12-19 05:47:36 +01:00
|
|
|
pub enum Error {
|
2021-02-11 22:35:53 +01:00
|
|
|
#[error("connection failed: {0}")]
|
|
|
|
|
ConnectionFailed(#[from] ConnectError),
|
|
|
|
|
#[error("connection errored: {0}")]
|
|
|
|
|
ConnectionErrored(#[from] ConnectionError),
|
|
|
|
|
#[error("reply failed: {0}")]
|
|
|
|
|
ReplyError(#[from] ReplyError),
|
|
|
|
|
#[error("timeout")]
|
2019-12-19 05:47:36 +01:00
|
|
|
Timeout,
|
2021-02-11 22:35:53 +01:00
|
|
|
#[error("unexpected type: {0}")]
|
2019-12-19 05:47:36 +01:00
|
|
|
UnexpectedType(Atom),
|
2021-03-06 04:34:02 +01:00
|
|
|
#[error("invalid utf8 string: {0}")]
|
|
|
|
|
InvalidUtf8(std::string::FromUtf8Error),
|
|
|
|
|
#[error("deadlock")]
|
|
|
|
|
SelectionLocked,
|
|
|
|
|
#[error("invalid selection owner")]
|
|
|
|
|
InvalidOwner,
|
|
|
|
|
#[error("worker communication error")]
|
|
|
|
|
SendError(#[from] mpsc::SendError<Atom>),
|
2019-12-19 05:47:36 +01:00
|
|
|
}
|