From 3ac78307ec0d6d1cfc7fa1848101faa9c0afc34f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 4 Jul 2022 14:57:26 -0700 Subject: Avoid separate lines for logging exceptions --- al/eax/utils.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'al/eax/utils.cpp') diff --git a/al/eax/utils.cpp b/al/eax/utils.cpp index 9fa2871d..1ee7dbc7 100644 --- a/al/eax/utils.cpp +++ b/al/eax/utils.cpp @@ -12,25 +12,16 @@ 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 - { + try { std::rethrow_exception(exception_ptr); } - catch (const std::exception& ex) - { + catch(const std::exception& ex) { const auto ex_message = ex.what(); - ERR("%s\n", ex_message); + ERR("%s %s\n", message ? message : "", ex_message); } - catch (...) - { - ERR("%s\n", "Generic exception."); + catch(...) { + ERR("%s %s\n", message ? message : "", "Generic exception."); } } -- cgit v1.2.3