Skip to content

Commit

Permalink
Add more missing data errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kg583 committed Jul 16, 2024
1 parent c78a689 commit 36b93f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tivars/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,11 @@ def __get__(self, instance, owner: type = None) -> _T:
if instance is None:
return self

return self._get(self._get_raw(instance), instance=instance)
try:
return self._get(self._get_raw(instance), instance=instance)

except IndexError:
raise ValueError(f"data '{self._name}' is empty or missing")

def __set__(self, instance, value: _T):
setattr(instance.raw, self._name, self._set_raw(instance, value))
Expand Down

0 comments on commit 36b93f3

Please sign in to comment.