Skip to content

Commit

Permalink
fix(McHDF): Add info output for a failing key/value pair
Browse files Browse the repository at this point in the history
  • Loading branch information
ibressler committed Apr 20, 2023
1 parent 6fe4e62 commit b301c36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mcsas3/McHDF.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ def storeKVPairs(filename: Path, path: PurePosixPath, pairs: Iterable) -> None:
"""Stores a given list of pairs (or iterable) to an HDF5 output file."""
assert filename is not None
assert path is not None
for key, value in pairs:
storeKV(filename=filename, path=path / key, value=value)
try:
for key, value in pairs:
storeKV(filename=filename, path=path / key, value=value)
except Exception:
print(f"Error for path {key} and value '{value}' of type {type(value)}.")
raise


def storeKV(filename: Path, path: PurePosixPath, value=None) -> None:
Expand Down

0 comments on commit b301c36

Please sign in to comment.