aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/http.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-03-19 21:14:48 +0000
committerRob Austein <sra@hactrn.net>2012-03-19 21:14:48 +0000
commit8e3eb0fc2b371e1eb0f93afad97ff6cd53e7d78b (patch)
treefb5df7edce1c65230beb4770de2d0561d7387cd8 /rpkid/rpki/http.py
parent4950a77da61c9993788c0557ef362ecdc0a1cf18 (diff)
parentd559bc6a29311fa1c414ce8cc3632f5f74ee8485 (diff)
Sync from trunk.
svn path=/branches/tk161/; revision=4403
Diffstat (limited to 'rpkid/rpki/http.py')
-rw-r--r--rpkid/rpki/http.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/rpkid/rpki/http.py b/rpkid/rpki/http.py
index 7d7e81ba..a0055ac9 100644
--- a/rpkid/rpki/http.py
+++ b/rpkid/rpki/http.py
@@ -766,7 +766,14 @@ class http_client(http_stream):
self.update_timeout()
if self.msg.code != 200:
- raise rpki.exceptions.HTTPRequestFailed, "HTTP request failed with status %s, reason %s, response %s" % (self.msg.code, self.msg.reason, self.msg.body)
+ errmsg = "HTTP request failed"
+ if self.msg.code is not None:
+ errmsg += " with status %s" % self.msg.code
+ if self.msg.reason:
+ errmsg += ", reason %s" % self.msg.reason
+ if self.msg.body:
+ errmsg += ", response %s" % self.msg.body
+ raise rpki.exceptions.HTTPRequestFailed(errmsg)
self.queue.return_result(self, self.msg, detach = self.expect_close)
def handle_close(self):