mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-03 05:57:40 -05:00
fix: Properly print fatal error messages when ImHex crashes
This commit is contained in:
@@ -31,7 +31,7 @@ namespace hex::crash {
|
|||||||
static std::function<void(const std::string&)> crashCallback = sendNativeMessage;
|
static std::function<void(const std::string&)> crashCallback = sendNativeMessage;
|
||||||
|
|
||||||
static void saveCrashFile(const std::string& message) {
|
static void saveCrashFile(const std::string& message) {
|
||||||
hex::unused(message);
|
log::fatal(message);
|
||||||
|
|
||||||
nlohmann::json crashData{
|
nlohmann::json crashData{
|
||||||
{"logFile", wolv::util::toUTF8String(hex::log::getFile().getPath())},
|
{"logFile", wolv::util::toUTF8String(hex::log::getFile().getPath())},
|
||||||
@@ -108,9 +108,7 @@ namespace hex::crash {
|
|||||||
try {
|
try {
|
||||||
std::rethrow_exception(std::current_exception());
|
std::rethrow_exception(std::current_exception());
|
||||||
} catch (std::exception &ex) {
|
} catch (std::exception &ex) {
|
||||||
std::string exceptionStr = hex::format("{}()::what() -> {}",
|
std::string exceptionStr = hex::format("{}()::what() -> {}", llvm::itaniumDemangle(typeid(ex).name(), nullptr, nullptr, nullptr), ex.what());
|
||||||
llvm::itaniumDemangle(typeid(ex).name(), nullptr, nullptr, nullptr), ex.what()
|
|
||||||
);
|
|
||||||
log::fatal("Program terminated with uncaught exception: {}", exceptionStr);
|
log::fatal("Program terminated with uncaught exception: {}", exceptionStr);
|
||||||
|
|
||||||
EventManager::post<EventAbnormalTermination>(0);
|
EventManager::post<EventAbnormalTermination>(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user