Skip to content

Commit

Permalink
Show more info when Legacy role galaxy info has unknown field
Browse files Browse the repository at this point in the history
Currently during legacy role import, if galaxy_info has an unknown
field, we see the following message:

  unknown field in galaxy_info

This is not very helpful, and does not tell us how to fix the issue.

This change adds the cause of the issue to the exception message, so we
know which field to fix.

Signed-off-by: Mark Goddard <[email protected]>
  • Loading branch information
markgoddard committed Dec 7, 2023
1 parent 3992f32 commit 3e0173f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion galaxy_importer/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def parse(cls, data):
try:
galaxy_info = LegacyGalaxyInfo(**metadata["galaxy_info"])
except TypeError as e:
raise exc.LegacyRoleSchemaError("unknown field in galaxy_info") from e
raise exc.LegacyRoleSchemaError(f"unknown field in galaxy_info: {e}") from e
dependencies = metadata.get("dependencies", list())
return cls(galaxy_info, dependencies)

Expand Down

0 comments on commit 3e0173f

Please sign in to comment.