aboutsummaryrefslogtreecommitdiffstats
path: root/al/eax/utils.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-05-16 02:08:18 -0700
committerChris Robinson <[email protected]>2022-05-16 02:08:18 -0700
commit65e4c20c27f2acf853e58fd4c26ebc0e3eb926c6 (patch)
tree4fb9a3bffbda4ab8dc1363caa2426cf8e8bbf30e /al/eax/utils.cpp
parent83238973ed08225adf03e76b6933e0c209f93fd9 (diff)
Move EAX files to their own sub-directory
Diffstat (limited to 'al/eax/utils.cpp')
-rw-r--r--al/eax/utils.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/al/eax/utils.cpp b/al/eax/utils.cpp
new file mode 100644
index 00000000..9fa2871d
--- /dev/null
+++ b/al/eax/utils.cpp
@@ -0,0 +1,36 @@
+#include "config.h"
+
+#include "utils.h"
+
+#include <cassert>
+#include <exception>
+
+#include "core/logging.h"
+
+
+void eax_log_exception(
+ const char* message) noexcept
+{
+ const auto exception_ptr = std::current_exception();
+
+ assert(exception_ptr);
+
+ if (message)
+ {
+ ERR("%s\n", message);
+ }
+
+ try
+ {
+ std::rethrow_exception(exception_ptr);
+ }
+ catch (const std::exception& ex)
+ {
+ const auto ex_message = ex.what();
+ ERR("%s\n", ex_message);
+ }
+ catch (...)
+ {
+ ERR("%s\n", "Generic exception.");
+ }
+}