Skip to content

Commit

Permalink
Raising exception if bucket deletion fails
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-widmann committed May 14, 2024
1 parent 81e5f81 commit c9b4c43
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions guillotina_s3storage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from botocore.config import Config
from guillotina import configure
from guillotina import task_vars
from guillotina.db.exceptions import DeleteStorageException
from guillotina.component import get_utility
from guillotina.exceptions import FileNotFoundException
from guillotina.files import BaseCloudFile
Expand Down Expand Up @@ -488,9 +489,7 @@ async def delete_bucket(self, bucket_name: Optional[str] = None):
"Bucket": bucket_name,
}

success = False

response = await client.delete_bucket(**args)
success = response["ResponseMetadata"]["HTTPStatusCode"] == 204

return success

if response["ResponseMetadata"]["HTTPStatusCode"] != 204:
raise DeleteStorageException()

0 comments on commit c9b4c43

Please sign in to comment.