summaryrefslogtreecommitdiff
path: root/common/rawaccel-error.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/rawaccel-error.hpp')
-rw-r--r--common/rawaccel-error.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/common/rawaccel-error.hpp b/common/rawaccel-error.hpp
new file mode 100644
index 0000000..f5498f9
--- /dev/null
+++ b/common/rawaccel-error.hpp
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <stdexcept>
+
+namespace rawaccel {
+
+ class error : public std::runtime_error {
+ using std::runtime_error::runtime_error;
+ };
+
+ class invalid_argument : public error {
+ using error::error;
+ };
+
+ class io_error : public error {
+ using error::error;
+ };
+
+ class install_error : public io_error {
+ public:
+ install_error() : io_error("rawaccel is not installed") {}
+ };
+
+ class cooldown_error : public io_error {
+ public:
+ cooldown_error() : io_error("write is on cooldown") {}
+ };
+
+}