I'm trying to upload a file in supabase storage, but it seems that if a file is already there then I get an exception StorageException "The resource already exists". It happens despite the fact that I have "upsert" : "true" file option, and also the statement is inside a try .. except block but the except doesnt catch the exception:
try:
result = supabase.storage.from_(STORAGE_BUCKET).upload(file=f, path=storagepath+'/'+basename, file_options={"content-type": "image/jpeg", "cache-control": "3600", "upsert": "true"})
except Exception as err:
strErr = str(err)
if "Duplicate" not in strErr:
raise Exception from err