From fdb1cace2da8a27c4e00fa03c843f6c5a5fdcaa0 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 13 Jun 2023 23:31:49 +0200 Subject: [PATCH] fix: Properly print fatal error messages when ImHex crashes --- main/source/crash_handlers.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main/source/crash_handlers.cpp b/main/source/crash_handlers.cpp index c0cf89ca2..f2919222c 100644 --- a/main/source/crash_handlers.cpp +++ b/main/source/crash_handlers.cpp @@ -31,7 +31,7 @@ namespace hex::crash { static std::function crashCallback = sendNativeMessage; static void saveCrashFile(const std::string& message) { - hex::unused(message); + log::fatal(message); nlohmann::json crashData{ {"logFile", wolv::util::toUTF8String(hex::log::getFile().getPath())}, @@ -108,9 +108,7 @@ namespace hex::crash { try { std::rethrow_exception(std::current_exception()); } catch (std::exception &ex) { - std::string exceptionStr = hex::format("{}()::what() -> {}", - llvm::itaniumDemangle(typeid(ex).name(), nullptr, nullptr, nullptr), ex.what() - ); + std::string exceptionStr = hex::format("{}()::what() -> {}", llvm::itaniumDemangle(typeid(ex).name(), nullptr, nullptr, nullptr), ex.what()); log::fatal("Program terminated with uncaught exception: {}", exceptionStr); EventManager::post(0);