More descriptive exception for reassign_class #3192

Added it because there was no error handling here anyway and later there was another UnboundLocalError:

    for attribute in declaration.all_attributes():
UnboundLocalError: local variable 'declaration' referenced before assignment
This commit is contained in:
Andrej730
2023-05-24 16:20:20 +05:00
parent 659cbe69c3
commit 4768ea23e4
@@ -68,7 +68,7 @@ def reassign_class(ifc_file, element, new_class):
try:
declaration = schema.declaration_by_name(new_class)
except:
print(f"Class of {element} could not be changed to {new_class} as the class does not exist")
raise Exception(f"Class of {element} could not be changed to {new_class} as the class does not exist")
info = element.get_info()