Skip to content

Commit

Permalink
Report exceptions that occur when calling a Lua command
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Feb 25, 2024
1 parent 96903d5 commit 74e4103
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/stratagus/engine_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
}

Expand Down

0 comments on commit 74e4103

Please sign in to comment.