Skip to content

Commit c4bfb06

Browse files
committed
Improve error messages
1 parent 825cd6e commit c4bfb06

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/zarr/storage/_fsspec.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,14 @@ def from_mapper(
174174
-------
175175
FsspecStore
176176
"""
177-
if not fs_map.fs.async_impl or not fs_map.fs.asynchronous:
178-
raise TypeError("Filesystem needs to support async operations.")
177+
if not fs_map.fs.async_impl:
178+
raise NotImplementedError(
179+
f"The filesystem '{fs_map.fs}' is synchronous and wrapping synchronous filesystems using from_mapper has not been implemented. See https://github.com/zarr-developers/zarr-python/issues/2706 for more details."
180+
)
181+
if not fs_map.fs.asynchronous:
182+
raise NotImplementedError(
183+
f"The filesystem '{fs_map.fs}' is synchronous and conversion to an async instance has not been implemented. See https://github.com/zarr-developers/zarr-python/issues/2706 for more details."
184+
)
179185
return cls(
180186
fs=fs_map.fs,
181187
path=fs_map.root,

0 commit comments

Comments
 (0)