2024-03-21 17:33:47 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
#include "utils.h"
|
|
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
#include <exception>
|
|
|
|
|
|
2024-06-30 14:35:57 -05:00
|
|
|
#include "alstring.h"
|
2024-03-21 17:33:47 +00:00
|
|
|
#include "core/logging.h"
|
|
|
|
|
|
|
|
|
|
|
2024-06-30 14:35:57 -05:00
|
|
|
void eax_log_exception(std::string_view message) noexcept
|
2024-03-21 17:33:47 +00:00
|
|
|
{
|
|
|
|
|
const auto exception_ptr = std::current_exception();
|
|
|
|
|
assert(exception_ptr);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
std::rethrow_exception(exception_ptr);
|
|
|
|
|
}
|
|
|
|
|
catch(const std::exception& ex) {
|
2024-06-30 14:35:57 -05:00
|
|
|
ERR("%.*s %s\n", al::sizei(message), message.data(), ex.what());
|
2024-03-21 17:33:47 +00:00
|
|
|
}
|
|
|
|
|
catch(...) {
|
2024-06-30 14:35:57 -05:00
|
|
|
ERR("%.*s %s\n", al::sizei(message), message.data(), "Generic exception.");
|
2024-03-21 17:33:47 +00:00
|
|
|
}
|
|
|
|
|
}
|