diff --git a/setup.cfg b/setup.cfg index fd22326..6db0187 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,7 @@ package_dir= =src packages = find: install_requires= - fsspec==2023.4.0 + fsspec==2023.5.0 oss2==2.17.0 aiooss2==0.2.5 diff --git a/src/ossfs/async_oss.py b/src/ossfs/async_oss.py index a5dc24e..ece02b1 100644 --- a/src/ossfs/async_oss.py +++ b/src/ossfs/async_oss.py @@ -100,7 +100,7 @@ def _get_bucket( app_name="ossfs", ) except ClientError as err: - raise ValueError(bucket_name) from err + raise FileNotFoundError(bucket_name) from err async def set_session(self, refresh: bool = False): """Establish a connection session object. @@ -337,7 +337,7 @@ async def _info(self, path: str, **kwargs): "name": path, "type": "directory", } - raise FileNotFoundError(norm_path) + raise FileNotFoundError(path) def _cache_result_analysis(self, norm_path: str, parent: str) -> bool: if norm_path in self.dircache: diff --git a/src/ossfs/core.py b/src/ossfs/core.py index 7490498..226249a 100644 --- a/src/ossfs/core.py +++ b/src/ossfs/core.py @@ -67,7 +67,7 @@ def _get_bucket( app_name="ossfs", ) except oss2.exceptions.ClientError as err: - raise ValueError(bucket_name) from err + raise FileNotFoundError(bucket_name) from err def _call_oss( self, diff --git a/tests/func/test_error.py b/tests/func/test_error.py index 3e65587..f981d30 100644 --- a/tests/func/test_error.py +++ b/tests/func/test_error.py @@ -26,7 +26,7 @@ def test_errors( with pytest.raises(FileNotFoundError): ossfs.mv(path + "x", path + "y") - with pytest.raises(ValueError): + with pytest.raises(FileNotFoundError): ossfs.open("x", "rb") with pytest.raises(FileNotFoundError):