summaryrefslogtreecommitdiff
path: root/common/rawaccel-error.hpp
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-08-11 21:16:50 -0700
committerJacob Palecki <[email protected]>2020-08-11 21:16:50 -0700
commit319eb45dee5b805eee976d7c2d6be0a9d090d3ed (patch)
treed164cf52ce420c2c51aee2e9c0fe67c5fe5b56c5 /common/rawaccel-error.hpp
parentFurther comments (diff)
parentMerge pull request #13 from a1xd/write-cd (diff)
downloadrawaccel-319eb45dee5b805eee976d7c2d6be0a9d090d3ed.tar.xz
rawaccel-319eb45dee5b805eee976d7c2d6be0a9d090d3ed.zip
Merge branch 'master' into GainCap
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") {}
+ };
+
+}