Hi,
I've been working on a simple script to help upload files to box.
I've noticed that when I try to upload a file that already exists I get a response back saying
Message: Item with the same name already exists
Status: 409
Code: item_name_in_use
etc.
How do I properly handle these exceptions in Python?
For instance if I use boto3 to connect to s3 I can do:
try:
bucket.download_file(file_loc, local_storage_file_name)
except botocore.exceptions.ClientError as e:
if e.response['Error']['Code'] == "404":
print(f"{s3_file_name} does not exist on s3.")
else:
raiseHow do I do something similar for Box API?