From 3e0173f6aee59506928a3397535892a62e5e250c Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 20 Oct 2023 11:32:24 +0100 Subject: [PATCH] Show more info when Legacy role galaxy info has unknown field 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 --- galaxy_importer/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy_importer/schema.py b/galaxy_importer/schema.py index ad1c6f16..425a5de9 100644 --- a/galaxy_importer/schema.py +++ b/galaxy_importer/schema.py @@ -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)