summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
new file mode 100644
index 0000000..e12ae2c
--- /dev/null
+++ b/src/error.rs
@@ -0,0 +1,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),
+}