diff options
author | Chris Robinson <[email protected]> | 2022-07-04 14:57:26 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-07-05 09:27:44 -0700 |
commit | 3ac78307ec0d6d1cfc7fa1848101faa9c0afc34f (patch) | |
tree | 9e69f63502a1057a98ee377ac71edca008c533e9 /al/eax/utils.cpp | |
parent | 221d33f3ea3f3e9a82ea4fe4ffda35860290cb64 (diff) |
Avoid separate lines for logging exceptions
Diffstat (limited to 'al/eax/utils.cpp')
-rw-r--r-- | al/eax/utils.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
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."); } } |