diff --git a/gcloud/storage/exceptions.py b/gcloud/storage/exceptions.py index 1d23a96cfdb8..dff01204bc95 100644 --- a/gcloud/storage/exceptions.py +++ b/gcloud/storage/exceptions.py @@ -14,7 +14,7 @@ def __init__(self, response, content): class NotFoundError(ConnectionError): def __init__(self, response, content): - self.message = 'GET %s returned a 404.' % (response.url) + self.message = 'Request returned a 404. Headers: %s' % (response) class StorageDataError(StorageError): diff --git a/gcloud/storage/test_connection.py b/gcloud/storage/test_connection.py index 0a6923d9b27e..cfb4ff60a6a9 100644 --- a/gcloud/storage/test_connection.py +++ b/gcloud/storage/test_connection.py @@ -1,10 +1,19 @@ import unittest2 from gcloud.storage.connection import Connection - +from gcloud.storage.exceptions import NotFoundError class TestConnection(unittest2.TestCase): def test_init(self): connection = Connection('project-name') self.assertEqual('project-name', connection.project) + + +class TestExceptions(unittest2.TestCase): + + def test_not_found_always_prints(self): + e = NotFoundError({}, None) + self.assertEqual('', str(e)) + +