Skip to content

Commit 0c77e6e

Browse files
committed
Use custom messages
1 parent e8827e2 commit 0c77e6e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/zarr/core/group.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,9 +676,11 @@ def from_dict(
676676
) -> AsyncGroup:
677677
node_type = data.pop("node_type", None)
678678
if node_type == "array":
679-
raise ContainsArrayError(store_path.store, store_path.path)
679+
msg = f"An array already exists in store {store_path.store} at path {store_path.path}."
680+
raise ContainsArrayError(msg)
680681
elif node_type not in ("group", None):
681-
raise GroupNotFoundError(store_path.store, store_path.path)
682+
msg = f"Node type in metadata ({node_type}) is not 'group'"
683+
raise GroupNotFoundError(msg)
682684
return cls(
683685
metadata=GroupMetadata.from_dict(data),
684686
store_path=store_path,

0 commit comments

Comments
 (0)