Skip to content

Commit 739101d

Browse files
committed
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).
1 parent d4c46af commit 739101d

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
@@ -378,7 +378,10 @@ def delete_bucket(self, bucket, force=False):
378378
379379
:rtype: bool
380380
:returns: True if the bucket was deleted.
381-
:raises: :class:`gcloud.storage.exceptions.NotFoundError`
381+
:raises: :class:`gcloud.storage.exceptions.NotFoundError` if the
382+
bucket doesn't exist, or
383+
:class:`gcloud.storage.exceptions.ConnectionError` if the
384+
bucket has keys and `force` is not passed.
382385
"""
383386
bucket = self.new_bucket(bucket)
384387

0 commit comments

Comments
 (0)