Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,18 @@ def _get_client(client, kwargs):
dir_client = client.get_directory_client(directory_path=total_path)
exists = False
from azure.core.exceptions import ClientAuthenticationError
from azure.core.exceptions import ResourceExistsError
try:
exists = dir_client.exists()
except ClientAuthenticationError:
exists = False
except ResourceExistsError as ex:
if hasattr(ex, "error_code") and ex.error_code == "DeletePending":
# translate delete pending flag as file/dir not exists.
exists = False
else:
raise ex

if not exists:
dir_client = client.get_directory_client(directory_path=directory_path)
client = dir_client.get_file_client(file_name=file_name)
Expand Down