Files
MapLibreParticleLab/include/mbgl/util/exception.hpp
John Firebaugh 16de579d7c [core] Rationalize error handling for resource loading
* Standardize on std::exception_ptr as the error representation
  (fixes #2854).
* Don't format textual strings at the error source; pass on the
  constituent data via observer method parameters instead.
* Use the null object pattern to simplify observer notification code.
* Further refactoring for ResourceLoading tests.
2015-12-23 12:50:42 -08:00

33 lines
890 B
C++

#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 SpriteImageException : Exception {
inline SpriteImageException(const char *msg) : Exception(msg) {}
inline SpriteImageException(const std::string &msg) : Exception(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) {}
};
} // namespace util
} // namespace mbgl
#endif