Skip to content

Commit af92e74

Browse files
author
Ali Afshar
committed
Merge pull request #94 from aliafshar/93
Don't assume that httplib2 responses contain any preset attributes, sinc...
2 parents 87c3e73 + 4dd8f67 commit af92e74

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

gcloud/storage/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(self, response, content):
1414
class NotFoundError(ConnectionError):
1515

1616
def __init__(self, response, content):
17-
self.message = 'GET %s returned a 404.' % (response.url)
17+
self.message = 'Request returned a 404. Headers: %s' % (response)
1818

1919

2020
class StorageDataError(StorageError):

gcloud/storage/test_connection.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
import unittest2
22

33
from gcloud.storage.connection import Connection
4-
4+
from gcloud.storage.exceptions import NotFoundError
55

66
class TestConnection(unittest2.TestCase):
77

88
def test_init(self):
99
connection = Connection('project-name')
1010
self.assertEqual('project-name', connection.project)
11+
12+
13+
class TestExceptions(unittest2.TestCase):
14+
15+
def test_not_found_always_prints(self):
16+
e = NotFoundError({}, None)
17+
self.assertEqual('', str(e))
18+
19+

0 commit comments

Comments
 (0)