From 74e41039aabcc0e3cdead3b8ce8860e042b686ba Mon Sep 17 00:00:00 2001 From: Andrettin <6322423+Andrettin@users.noreply.github.com> Date: Sun, 25 Feb 2024 21:12:09 +0100 Subject: [PATCH] Report exceptions that occur when calling a Lua command --- src/stratagus/engine_interface.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/stratagus/engine_interface.cpp b/src/stratagus/engine_interface.cpp index f522a0229..c5a8a7142 100644 --- a/src/stratagus/engine_interface.cpp +++ b/src/stratagus/engine_interface.cpp @@ -157,7 +157,12 @@ QString engine_interface::get_user_maps_path() const void engine_interface::call_lua_command(const QString &command) { QTimer::singleShot(0, [command]() { - CclCommand(command.toStdString()); + try { + CclCommand(command.toStdString()); + } catch (...) { + exception::report(std::current_exception()); + std::terminate(); + } }); }