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:
parent
4062f579e3
commit
08c666156b
1 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue