Mystery: mention failing option name

This commit is contained in:
Fabian Dill
2021-07-09 03:06:16 +02:00
parent 172c1789a8
commit 6ac74f5686
2 changed files with 7 additions and 8 deletions

View File

@@ -550,10 +550,13 @@ def roll_settings(weights: dict, plando_options: typing.Set[str] = frozenset(("b
if ret.game in AutoWorldRegister.world_types:
for option_name, option in AutoWorldRegister.world_types[ret.game].options.items():
if option_name in game_weights:
if issubclass(option, Options.OptionDict):
setattr(ret, option_name, option.from_any(game_weights[option_name]))
else:
setattr(ret, option_name, option.from_any(get_choice(option_name, game_weights)))
try:
if issubclass(option, Options.OptionDict):
setattr(ret, option_name, option.from_any(game_weights[option_name]))
else:
setattr(ret, option_name, option.from_any(get_choice(option_name, game_weights)))
except Exception as e:
raise Exception(f"Error generating option {option_name} in {ret.game}")
else:
setattr(ret, option_name, option(option.default))
if ret.game == "Minecraft":