File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 3939)
4040from zarr .core .metadata import ArrayMetadataDict , ArrayV2Metadata , ArrayV3Metadata
4141from zarr .core .metadata .v2 import _default_compressor , _default_filters
42- from zarr .errors import NodeTypeValidationError
42+ from zarr .errors import GroupNotFoundError , NodeTypeValidationError
4343from zarr .storage ._common import make_store_path
4444
4545if TYPE_CHECKING :
@@ -836,7 +836,7 @@ async def open_group(
836836 overwrite = overwrite ,
837837 attributes = attributes ,
838838 )
839- raise FileNotFoundError ( f"Unable to find group: { store_path } " )
839+ raise GroupNotFoundError ( store , store_path . path )
840840
841841
842842async def create (
Original file line number Diff line number Diff line change 1010]
1111
1212
13- class BaseZarrError (ValueError ):
13+ class BaseZarrError (Exception ):
1414 """
1515 Base error which all zarr errors are sub-classed from.
1616 """
@@ -21,6 +21,14 @@ def __init__(self, *args: Any) -> None:
2121 super ().__init__ (self ._msg .format (* args ))
2222
2323
24+ class GroupNotFoundError (BaseZarrError , FileNotFoundError ):
25+ """
26+ Raised when a group isn't found at a certain path.
27+ """
28+
29+ _msg = "No group found in store {!r} at path {!r}"
30+
31+
2432class ContainsGroupError (BaseZarrError ):
2533 """Raised when a group already exists at a certain path."""
2634
You can’t perform that action at this time.
0 commit comments