From 025654a101eada83c23178ae39e48a0fe495a6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Fri, 13 Feb 2015 14:51:01 -0800 Subject: throw exception when shader compilation fails --- include/mbgl/util/exception.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/mbgl/util/exception.hpp (limited to 'include/mbgl/util') 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 + +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 -- cgit v1.2.1