31 #ifndef OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED 32 #define OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED 52 const char*
what() const noexcept
override 54 try {
return mMessage.c_str(); }
catch (...) {}
60 explicit Exception(
const char* eType,
const std::string*
const msg =
nullptr) noexcept
63 if (eType) mMessage = eType;
64 if (msg) mMessage +=
": " + (*msg);
73 #define OPENVDB_EXCEPTION(_classname) \ 74 class OPENVDB_API _classname: public Exception \ 77 _classname() noexcept: Exception( #_classname ) {} \ 78 explicit _classname(const std::string& msg) noexcept: Exception( #_classname , &msg) {} \ 95 #undef OPENVDB_EXCEPTION 101 #define OPENVDB_THROW(exception, message) \ 103 std::string _openvdb_throw_msg; \ 105 std::ostringstream _openvdb_throw_os; \ 106 _openvdb_throw_os << message; \ 107 _openvdb_throw_msg = _openvdb_throw_os.str(); \ 109 throw exception(_openvdb_throw_msg); \ 112 #endif // OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED
Definition: Exceptions.h:83
Definition: Exceptions.h:90
Definition: Exceptions.h:89
#define OPENVDB_VERSION_NAME
Definition: version.h:43
Definition: Exceptions.h:87
Definition: Exceptions.h:91
const char * what() const noexcept override
Definition: Exceptions.h:52
Definition: Exceptions.h:39
Definition: Exceptions.h:82
Definition: Exceptions.h:92
Definition: Exceptions.h:85
Definition: Exceptions.h:88
Definition: Exceptions.h:43
Definition: Exceptions.h:84
Exception(const char *eType, const std::string *const msg=nullptr) noexcept
Definition: Exceptions.h:60
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:71
Definition: Exceptions.h:86
Exception() noexcept
Definition: Exceptions.h:59
#define OPENVDB_EXCEPTION(_classname)
Definition: Exceptions.h:73