diff options
Diffstat (limited to 'common/alexcpt.h')
-rw-r--r-- | common/alexcpt.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/alexcpt.h b/common/alexcpt.h index 3e31667e..b4f6f55e 100644 --- a/common/alexcpt.h +++ b/common/alexcpt.h @@ -2,7 +2,25 @@ #define ALEXCPT_H #include <exception> +#include <string> +#include "AL/alc.h" + + +namespace al { + +class backend_exception final : public std::exception { + std::string mMessage; + ALCenum mErrorCode; + +public: + backend_exception(ALCenum code, const char *msg, ...); + + const char *what() const noexcept override { return mMessage.c_str(); } + ALCenum errorCode() const noexcept { return mErrorCode; } +}; + +} // namespace al #define START_API_FUNC try |