mirror of
https://github.com/arabianq/viking-file-python.git
synced 2026-04-27 22:21:21 +00:00
get_file now raises FileNotFoundError instead of FileExistError
This commit is contained in:
@@ -241,7 +241,7 @@ class AsyncVikingClient:
|
|||||||
File: The file information.
|
File: The file information.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
FileExistsError: If the file does not exist.
|
FileNotFoundError: If the file does not exist.
|
||||||
"""
|
"""
|
||||||
file_hash = self._get_file_hash(file)
|
file_hash = self._get_file_hash(file)
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ class AsyncVikingClient:
|
|||||||
downloads=api_response_json.get("downloads")
|
downloads=api_response_json.get("downloads")
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
raise FileExistsError(f"File {file_hash} does not exist")
|
raise FileNotFoundError(f"File {file_hash} does not exist")
|
||||||
|
|
||||||
async def rename_file(self, file: File | str, new_filename: str):
|
async def rename_file(self, file: File | str, new_filename: str):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user