mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
fix: Handle uncaught exceptions more gracefully
This commit is contained in:
@@ -274,8 +274,12 @@ namespace hex::init {
|
||||
// Run all exit tasks, and print to console
|
||||
void runExitTasks() {
|
||||
for (const auto &[name, task, async, running] : init::getExitTasks()) {
|
||||
const bool result = task();
|
||||
log::info("Exit task '{0}' finished {1}", name, result ? "successfully" : "unsuccessfully");
|
||||
try {
|
||||
const bool result = task();
|
||||
log::info("Exit task '{0}' finished {1}", name, result ? "successfully" : "unsuccessfully");
|
||||
} catch (const std::exception &e) {
|
||||
log::error("Exit task '{}' failed with exception: {}", name, e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user