Skip to content
Merged
Show file tree
Hide file tree
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
Document exceptions (currently) raised from 'Bucket.delete'.
Note that #164 would change this (by adding fine-grained exceptions
for 409, 401, etc.).

Fixes #159 (but should be revisited if #164 lands).
  • Loading branch information
tseaver committed Oct 31, 2014
commit 739101daaacf3ded43dbb33ef213c0dfc4efb9ac
5 changes: 4 additions & 1 deletion gcloud/storage/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ def delete(self, force=False):
:type force: bool
:param full: If True, empties the bucket's objects then deletes it.

:raises: :class:`gcloud.storage.exceptions.NotFoundError`
:raises: :class:`gcloud.storage.exceptions.NotFoundError` if the
bucket does not exist, or
:class:`gcloud.storage.exceptions.ConnectionError` if the
bucket has keys and `force` is not passed.
"""
return self.connection.delete_bucket(self.name, force=force)

Expand Down
5 changes: 4 additions & 1 deletion gcloud/storage/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,10 @@ def delete_bucket(self, bucket, force=False):

:rtype: bool
:returns: True if the bucket was deleted.
:raises: :class:`gcloud.storage.exceptions.NotFoundError`
:raises: :class:`gcloud.storage.exceptions.NotFoundError` if the
bucket doesn't exist, or
:class:`gcloud.storage.exceptions.ConnectionError` if the
bucket has keys and `force` is not passed.
"""
bucket = self.new_bucket(bucket)

Expand Down