fix pack.assemble & app.reconfig_packs/app.config_packs missing packs non-informative error messages

This commit is contained in:
MihailRis 2025-01-26 09:56:06 +03:00
parent ac3b3e85f9
commit e03467cd1c
2 changed files with 14 additions and 2 deletions

View File

@ -148,7 +148,13 @@ static int l_reconfig_packs(lua::State* L) {
lua::pop(L); lua::pop(L);
} }
auto engineController = engine->getController(); auto engineController = engine->getController();
try {
engineController->reconfigPacks(controller, addPacks, remPacks); engineController->reconfigPacks(controller, addPacks, remPacks);
} catch (const contentpack_error& err) {
throw std::runtime_error(
std::string(err.what()) + " [" + err.getPackId() + " ]"
);
}
return 0; return 0;
} }

View File

@ -231,7 +231,13 @@ static int l_pack_assemble(lua::State* L) {
} }
auto manager = engine->createPacksManager(worldFolder); auto manager = engine->createPacksManager(worldFolder);
manager.scan(); manager.scan();
try {
ids = std::move(manager.assemble(ids)); ids = std::move(manager.assemble(ids));
} catch (const contentpack_error& err) {
throw std::runtime_error(
std::string(err.what()) + " [" + err.getPackId() + "]"
);
}
lua::createtable(L, ids.size(), 0); lua::createtable(L, ids.size(), 0);
for (size_t i = 0; i < ids.size(); i++) { for (size_t i = 0; i < ids.size(); i++) {