From 124ce13da75747be31da09358208d851ad8da3fb Mon Sep 17 00:00:00 2001 From: Doug Hoskisson Date: Wed, 20 Nov 2024 00:45:41 -0800 Subject: [PATCH] Core: improve error message for missing "game" entry in yaml (#4185) --- Generate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Generate.py b/Generate.py index bc359a20..8aba72ab 100644 --- a/Generate.py +++ b/Generate.py @@ -453,6 +453,10 @@ def roll_settings(weights: dict, plando_options: PlandoOptions = PlandoOptions.b raise Exception(f"Option {option_key} has to be in a game's section, not on its own.") ret.game = get_choice("game", weights) + if not isinstance(ret.game, str): + if ret.game is None: + raise Exception('"game" not specified') + raise Exception(f"Invalid game: {ret.game}") if ret.game not in AutoWorldRegister.world_types: from worlds import failed_world_loads picks = Utils.get_fuzzy_results(ret.game, list(AutoWorldRegister.world_types) + failed_world_loads, limit=1)[0]