fix: Handling of exceptions that are not being caught

This commit is contained in:
WerWolv
2022-10-03 10:36:19 +02:00
parent accd554600
commit b17cd3696c
6 changed files with 46 additions and 39 deletions

View File

@@ -57,7 +57,15 @@ int main(int argc, char **argv, char **envp) {
EventManager::post<RequestOpenFile>(argv[i]);
}
window.loop();
try {
window.loop();
} catch (const std::exception &e) {
log::fatal("Exception thrown in main loop: {}", e.what());
return EXIT_FAILURE;
} catch (...) {
log::fatal("Unknown exception thrown in main loop!");
return EXIT_FAILURE;
}
}
} while (shouldRestart);