diff options
| author | a1xd <[email protected]> | 2020-08-11 23:49:34 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-08-11 23:49:34 -0400 |
| commit | 08759509371ada546c8d9bc4053b9450c4f58e8b (patch) | |
| tree | 7ffc41237725e3ec0e9f53313644365912ded060 /common/rawaccel-error.hpp | |
| parent | Merge pull request #12 from JacobPalecki/GUI (diff) | |
| parent | define exceptions for invalid arg & io errors (diff) | |
| download | rawaccel-08759509371ada546c8d9bc4053b9450c4f58e8b.tar.xz rawaccel-08759509371ada546c8d9bc4053b9450c4f58e8b.zip | |
Merge pull request #13 from a1xd/write-cd
write cooldown
Diffstat (limited to 'common/rawaccel-error.hpp')
| -rw-r--r-- | common/rawaccel-error.hpp | 29 |
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") {} + }; + +} |