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 39
39
)
40
40
from zarr .core .metadata import ArrayMetadataDict , ArrayV2Metadata , ArrayV3Metadata
41
41
from zarr .core .metadata .v2 import _default_compressor , _default_filters
42
- from zarr .errors import NodeTypeValidationError
42
+ from zarr .errors import GroupNotFoundError , NodeTypeValidationError
43
43
from zarr .storage ._common import make_store_path
44
44
45
45
if TYPE_CHECKING :
@@ -837,7 +837,7 @@ async def open_group(
837
837
overwrite = overwrite ,
838
838
attributes = attributes ,
839
839
)
840
- raise FileNotFoundError ( f"Unable to find group: { store_path } " )
840
+ raise GroupNotFoundError ( store , store_path . path )
841
841
842
842
843
843
async def create (
Original file line number Diff line number Diff line change 10
10
]
11
11
12
12
13
- class BaseZarrError (ValueError ):
13
+ class BaseZarrError (Exception ):
14
14
"""
15
15
Base error which all zarr errors are sub-classed from.
16
16
"""
@@ -21,6 +21,14 @@ def __init__(self, *args: Any) -> None:
21
21
super ().__init__ (self ._msg .format (* args ))
22
22
23
23
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
+
24
32
class ContainsGroupError (BaseZarrError ):
25
33
"""Raised when a group already exists at a certain path."""
26
34
You can’t perform that action at this time.
0 commit comments