Action wml unit better error (#9402)

* Better error message for ActionWML [unit]

---------

Co-authored-by: SomeName42 <>
Co-authored-by: Gunter Labes <soliton@wesnoth.org>
This commit is contained in:
Tóth Kornél 2024-10-03 20:59:00 +02:00 committed by GitHub
parent 4062f579e3
commit 08c666156b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -894,8 +894,16 @@ WML_HANDLER_FUNCTION(unit,, cfg)
.allow_rename_side(true)
.allow_show(true);
uc.add_unit(parsed_cfg, &cfg);
try
{
uc.add_unit(parsed_cfg, &cfg);
}
catch(const unit_type::error& e)
{
ERR_WML << "Error occured inside [unit]: " << e.what();
throw;
}
}
} // end namespace game_events