summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-02-13 14:51:01 -0800
committerKonstantin Käfer <mail@kkaefer.com>2015-03-06 15:42:34 +0100
commit025654a101eada83c23178ae39e48a0fe495a6f5 (patch)
tree2bee398a37ecc1db7f33b77feee019f7806859d4 /include/mbgl
parente8389d82cdd84d470deb072d82ee9a613cd15df8 (diff)
downloadqtlocation-mapboxgl-025654a101eada83c23178ae39e48a0fe495a6f5.tar.gz
throw exception when shader compilation fails
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/util/exception.hpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/mbgl/util/exception.hpp b/include/mbgl/util/exception.hpp
new file mode 100644
index 0000000000..0b4403270c
--- /dev/null
+++ b/include/mbgl/util/exception.hpp
@@ -0,0 +1,27 @@
+#ifndef MBGL_UTIL_EXCEPTION
+#define MBGL_UTIL_EXCEPTION
+
+#include <stdexcept>
+
+namespace mbgl {
+namespace util {
+
+struct Exception : std::runtime_error {
+ inline Exception(const char *msg) : std::runtime_error(msg) {}
+ inline Exception(const std::string &msg) : std::runtime_error(msg) {}
+};
+
+struct MisuseException : Exception {
+ inline MisuseException(const char *msg) : Exception(msg) {}
+ inline MisuseException(const std::string &msg) : Exception(msg) {}
+};
+
+struct ShaderException : Exception {
+ inline ShaderException(const char *msg) : Exception(msg) {}
+ inline ShaderException(const std::string &msg) : Exception(msg) {}
+};
+
+}
+}
+
+#endif