diff --git a/modelx/core/space.py b/modelx/core/space.py index 08a518c..73a8267 100644 --- a/modelx/core/space.py +++ b/modelx/core/space.py @@ -306,7 +306,8 @@ def __getattr__(self, name): if name in self._impl.namespace: return self._impl.get_attr(name) else: - raise AttributeError # Must return AttributeError for hasattr + raise AttributeError(f"Attribute '{name}' is not in space {str(self)}") + # Must return AttributeError for hasattr def __dir__(self): return list(self._impl.namespace.interfaces)