From da39c903f383e88fc9a71b50d34957d0f8a0ba55 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 10 Feb 2023 21:07:25 +0100 Subject: [PATCH] Latebound schema handling: Improve error messages --- src/ifcopenshell-python/ifcopenshell/express/schema_class.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/express/schema_class.py b/src/ifcopenshell-python/ifcopenshell/express/schema_class.py index 1c89db6973..e6e4b1aeef 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/schema_class.py +++ b/src/ifcopenshell-python/ifcopenshell/express/schema_class.py @@ -372,9 +372,10 @@ class SchemaClass(codegen.Base): else: return x.simple_type(type) else: - raise ValueError("No mapping for '%s'" % type) + raise ValueError("No declared type for <%r>" % type) def find_inverse_name_and_index(entity_name, attribute_name): + entity_name_orig = entity_name attributes_per_subtype = [] while True: entity = mapping.schema.entities[entity_name] @@ -392,7 +393,7 @@ class SchemaClass(codegen.Base): pass else: - raise Exception("No declared type for <%r>" % type) + raise Exception("No attribute named %s.%s" % (entity_name_orig, attribute_name)) collections_by_type = ( ("entity", mapping.schema.entities),