ArchipelagoMW / Archipelago

Archipelago Multi-Game Randomizer and Server
https://archipelago.gg
Other
515 stars 671 forks source link

Core: improve error message for missing "game" entry in yaml #4185

Closed beauxq closed 2 days ago

beauxq commented 1 week ago

What is this fixing or adding?

If a yaml has no "game" entry, the message to users is confusing. 'NoneType' object has no attribute 'lower'

This changes it to Missing "game" entry in yaml

How was this tested?

ran generate with the bad yaml and saw error message ran generate with a good yaml to make sure it works

Berserker66 commented 1 week ago

I agree the message could be better, I disagree with referring to yaml specifically

Exempt-Medic commented 1 week ago

I agree the message could be better, I disagree with referring to yaml specifically

And you would prefer what? "File {file_name}"?

beauxq commented 1 week ago

I thought of using the file name, but I don't see the file name being available in this function.

I think just deleting "in yaml" could be ok - if that's what others think would be better. (This exception leads to another exception that tells which file it is.)

Zannick commented 1 week ago

Maybe "game" not specified? Invalid game: {ret.game} would be fine for the other case.