File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 4040)
4141from zarr .core .metadata import ArrayMetadataDict , ArrayV2Metadata , ArrayV3Metadata
4242from zarr .errors import (
43+ ArrayNotFoundError ,
4344 GroupNotFoundError ,
4445 NodeTypeValidationError ,
4546 ZarrDeprecationWarning ,
@@ -1257,7 +1258,7 @@ async def open_array(
12571258
12581259 try :
12591260 return await AsyncArray .open (store_path , zarr_format = zarr_format )
1260- except FileNotFoundError :
1261+ except FileNotFoundError as err :
12611262 if not store_path .read_only and mode in _CREATE_MODES :
12621263 overwrite = _infer_overwrite (mode )
12631264 _zarr_format = zarr_format or _default_zarr_format ()
@@ -1267,7 +1268,7 @@ async def open_array(
12671268 overwrite = overwrite ,
12681269 ** kwargs ,
12691270 )
1270- raise
1271+ raise ArrayNotFoundError ( store_path . store , store_path . path ) from err
12711272
12721273
12731274async def open_like (
Original file line number Diff line number Diff line change 11from typing import Any
22
33__all__ = [
4+ "ArrayNotFoundError" ,
45 "BaseZarrError" ,
56 "ContainsArrayAndGroupError" ,
67 "ContainsArrayError" ,
@@ -34,6 +35,10 @@ class GroupNotFoundError(BaseZarrError, FileNotFoundError):
3435 _msg = "No group found in store {!r} at path {!r}"
3536
3637
38+ class ArrayNotFoundError (BaseZarrError ):
39+ _msg = "array not found at path %r' {0!r}"
40+
41+
3742class ContainsGroupError (BaseZarrError ):
3843 """Raised when a group already exists at a certain path."""
3944
You can’t perform that action at this time.
0 commit comments