diff options
author | W. Trevor King <wking@tremily.us> | 2012-08-24 07:24:31 -0400 |
---|---|---|
committer | W. Trevor King <wking@tremily.us> | 2012-08-24 07:27:14 -0400 |
commit | 171378e7399e7ff2651e879a8a8f4108152a6acb (patch) | |
tree | 9df059a20b7d50d710774f92d4d5dafdc45eda1d /libbe/storage | |
parent | eb9f603707d932641b8c580bde91ddb7d54741e0 (diff) | |
download | bugseverywhere-171378e7399e7ff2651e879a8a8f4108152a6acb.tar.gz |
storage:http: adjust HTTPError message in get_post_url.
We'll usually get this message if we fail to reach the server, but we
can also get it if the server is so broken that it dies without
returning a valid HTTP response.
Diffstat (limited to 'libbe/storage')
-rw-r--r-- | libbe/storage/http.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libbe/storage/http.py b/libbe/storage/http.py index cfed7b7..20dade4 100644 --- a/libbe/storage/http.py +++ b/libbe/storage/http.py @@ -112,8 +112,8 @@ def get_post_url(url, get=True, data_dict=None, headers=[], agent=None): response = urllib2.urlopen(req) except urllib2.HTTPError, e: if hasattr(e, 'reason'): - msg = 'We failed to reach a server.\nURL: %s\nReason: %s' \ - % (url, e.reason) + msg = ('We failed to connect to the server.\nURL: {}\n' + 'Reason: {}').format(url, e.reason) elif hasattr(e, 'code'): msg = "The server couldn't fulfill the request.\nURL: %s\nError code: %s" \ % (url, e.code) |