mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user