Skip to content

Commit 8e12e10

Browse files
committed
Merge pull request #321 from tseaver/159-document_exceptions_for_bucket_delete
Fix #159: Document exceptions (currently) raised from 'Bucket.delete'.
2 parents da8dc57 + 739101d commit 8e12e10

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

gcloud/storage/bucket.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ def delete(self, force=False):
144144
:type force: bool
145145
:param full: If True, empties the bucket's objects then deletes it.
146146
147-
:raises: :class:`gcloud.storage.exceptions.NotFoundError`
147+
:raises: :class:`gcloud.storage.exceptions.NotFoundError` if the
148+
bucket does not exist, or
149+
:class:`gcloud.storage.exceptions.ConnectionError` if the
150+
bucket has keys and `force` is not passed.
148151
"""
149152
return self.connection.delete_bucket(self.name, force=force)
150153

gcloud/storage/connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,10 @@ def delete_bucket(self, bucket, force=False):
380380
381381
:rtype: bool
382382
:returns: True if the bucket was deleted.
383-
:raises: :class:`gcloud.storage.exceptions.NotFoundError`
383+
:raises: :class:`gcloud.storage.exceptions.NotFoundError` if the
384+
bucket doesn't exist, or
385+
:class:`gcloud.storage.exceptions.ConnectionError` if the
386+
bucket has keys and `force` is not passed.
384387
"""
385388
bucket = self.new_bucket(bucket)
386389

0 commit comments

Comments
 (0)