1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-04 02:26:16 +01:00

urlopen(): for server return code 500, print out the reply body

This commit is contained in:
Dr. Peter Poeml 2006-09-18 16:53:55 +00:00
parent 755a4e7626
commit 79092b2a86

View File

@ -583,6 +583,8 @@ def urlopen(url, data=None):
except urllib2.HTTPError, e:
print >>sys.stderr, 'Error: can\'t get \'%s\'' % url
print >>sys.stderr, e
if e.code == 500:
print >>sys.stderr, '\nDebugging output follows.\nurl:\n%s\nresponse:\n%s' % (url, e.read())
sys.exit(1)
return fd