aboutsummaryrefslogtreecommitdiffstats
path: root/common/alexcpt.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-05-04 18:03:25 -0700
committerChris Robinson <[email protected]>2019-05-04 18:03:25 -0700
commit5ff8d5ae32943c5325172799f31b7c5b66c4f054 (patch)
tree1920073d9a1325f8d203fa187e2a9bf1b7d8b011 /common/alexcpt.h
parent1607f9c525eedb4af5b736990fd4e6640f37def0 (diff)
Add an exception class to cover backend creation and opening
Diffstat (limited to 'common/alexcpt.h')
-rw-r--r--common/alexcpt.h18
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