Skip to content

Commit

Permalink
Merge pull request #321 from tseaver/159-document_exceptions_for_buck…
Browse files Browse the repository at this point in the history
…et_delete

Fix #159: Document exceptions (currently) raised from 'Bucket.delete'.
  • Loading branch information
tseaver committed Oct 31, 2014
2 parents da8dc57 + 739101d commit 8e12e10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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 @@ -380,7 +380,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

0 comments on commit 8e12e10

Please sign in to comment.