From 41661d741a4b013dc1031563c5d4809362565167 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Thu, 2 May 2013 22:33:04 +0200 Subject: [PATCH] - babysitter: print out headers in case of status 5XX --- osc/babysitter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osc/babysitter.py b/osc/babysitter.py index aa6de60b..1f9fd146 100644 --- a/osc/babysitter.py +++ b/osc/babysitter.py @@ -122,6 +122,13 @@ def run(prg): msg = body.split('')[1] msg = msg.split('')[0] print(msg, file=sys.stderr) + if e.code >= 500 and e.code <= 599: + print('\nRequest: %s' % e.filename) + print('Headers:') + for h, v in e.hdrs.items(): + if h != 'Set-Cookie': + print("%s: %s" % (h, v)) + return 1 except BadStatusLine as e: print('Server returned an invalid response:', e, file=sys.stderr)