axmol/thirdparty/openal/al/eax/utils.cpp

27 lines
555 B
C++
Raw Normal View History

2022-04-25 12:02:45 +08:00
#include "config.h"
#include "utils.h"
2022-04-25 12:02:45 +08:00
#include <cassert>
#include <exception>
#include "core/logging.h"
2023-02-04 15:03:54 +08:00
void eax_log_exception(const char *message) noexcept
2022-04-25 12:02:45 +08:00
{
const auto exception_ptr = std::current_exception();
assert(exception_ptr);
2023-02-04 15:03:54 +08:00
try {
2022-04-25 12:02:45 +08:00
std::rethrow_exception(exception_ptr);
}
2023-02-04 15:03:54 +08:00
catch(const std::exception& ex) {
2022-04-25 12:02:45 +08:00
const auto ex_message = ex.what();
2023-02-04 15:03:54 +08:00
ERR("%s %s\n", message ? message : "", ex_message);
2022-04-25 12:02:45 +08:00
}
2023-02-04 15:03:54 +08:00
catch(...) {
ERR("%s %s\n", message ? message : "", "Generic exception.");
2022-04-25 12:02:45 +08:00
}
}