sql, stream - more clear error message when accessing wrapped_data

This commit is contained in:
Andrej730
2025-11-04 18:39:45 +05:00
parent 4e1d0bcf22
commit 04d1fe4052
2 changed files with 6 additions and 4 deletions
@@ -287,8 +287,9 @@ try:
# Override to avoid clean up unrelated to stream file.
pass
def wrapped_data(self) -> NoReturn:
class_name = str(type(self))
@property
def wrapped_data(self) -> NoReturn: # pyright: ignore[reportIncompatibleVariableOverride]
class_name = type(self).__name__
raise Exception(
f"No `wrapped_data` for {class_name}. `ifcopenshell.{class_name}` is probably confused with `ifcopenshell.file`."
)