Skip to content

Commit

Permalink
rethrow with more information
Browse files Browse the repository at this point in the history
  • Loading branch information
XzzX committed Jan 15, 2025
1 parent 41967d1 commit d4d8557
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pyiron_xzzx/generic_storage/hdf5_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ def __setitem__(self, key: str, value: Any):
group["_type"] = "@".join([module, qualname, version])
unwrap_dataclass(group, value)
return

self.data[key] = value
try:
self.data[key] = value
except TypeError as type_error:
raise TypeError(
f"'{key}' of type {type(value)} cannot be written to HDF5."
) from type_error

def __iter__(self):
return iter(self.data)
Expand Down

0 comments on commit d4d8557

Please sign in to comment.