chiark / gitweb /
better message from client on http errors
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 24 Apr 2017 12:20:29 +0000 (13:20 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 24 Apr 2017 12:20:29 +0000 (13:20 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
hippotat

index f9395f2..248538e 100755 (executable)
--- a/hippotat
+++ b/hippotat
@@ -152,7 +152,8 @@ class Client():
       cl.log(DBG.HTTP_CTRL, 'req_err ' + str(err), idof=req)
       if isinstance(err, twisted.python.failure.Failure):
         err = err.getTraceback()
-      print('[%#x] %s' % (id(req), err), file=sys.stderr)
+      print('%s[%#x] %s' % (cl.desc, id(req), err.strip('\n').replace('\n',' / ')),
+            file=sys.stderr)
       if not isinstance(cl.outstanding[req], int):
         raise RuntimeError('[%#x] previously %s' %
                            (id(req), cl.outstanding[req]))