diff options
author | crupest <crupest@outlook.com> | 2020-06-28 00:03:11 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-28 00:03:11 +0800 |
commit | 06d1d0442276a05b6caad6e3468f4afb1e8ee5df (patch) | |
tree | ebd46f0fb7343dc57bf947b7b5fffc139c3ddeac /include/cru/platform/Exception.hpp | |
parent | e11be6caa9ef9b2b198ca61846e32f469627556e (diff) | |
download | cru-06d1d0442276a05b6caad6e3468f4afb1e8ee5df.tar.gz cru-06d1d0442276a05b6caad6e3468f4afb1e8ee5df.tar.bz2 cru-06d1d0442276a05b6caad6e3468f4afb1e8ee5df.zip |
...
Diffstat (limited to 'include/cru/platform/Exception.hpp')
-rw-r--r-- | include/cru/platform/Exception.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/cru/platform/Exception.hpp b/include/cru/platform/Exception.hpp new file mode 100644 index 00000000..8b958a1d --- /dev/null +++ b/include/cru/platform/Exception.hpp @@ -0,0 +1,28 @@ +#pragma once +#include "cru/common/Base.hpp" + +#include <stdexcept> + +namespace cru::platform { +class PlatformException : public std::runtime_error { + public: + using runtime_error::runtime_error; // inherit constructors +}; + +// This exception is thrown when a resource is used on another platform. +// Of course, you can't mix resources of two different platform. +// For example, Win32 Brush (may add in the future) with Direct Painter. +class UnsupportPlatformException : public std::runtime_error { + public: + using runtime_error::runtime_error; // inherit constructors +}; + +// This exception is thrown when a resource has been disposed and not usable +// again. +// For example, calling Build twice on a GeometryBuilder::Build will lead to +// this exception. +class ReuseException : public std::runtime_error { + public: + using runtime_error::runtime_error; // inherit constructors +}; +} // namespace cru::platform |