1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-24 22:06:14 +01:00

Handle also errors which can sneak out of httplib

This commit is contained in:
Michal Čihař 2011-05-26 11:54:14 +02:00
parent 8dd0d9f8e3
commit e0b7f69fe6

View File

@ -9,6 +9,7 @@ import signal
import errno
from osc import oscerr
from urllib2 import URLError, HTTPError
from httplib import HTTPException, BadStatusLine
from oscsslexcp import NoSecureSSLError
from osc.util.cpio import CpioError
from osc.util.packagequery import PackageError
@ -123,6 +124,15 @@ def run(prg):
return 1
except BadStatusLine, e:
print >>sys.stderr, 'Server returned an invalid response:', e
print >>sys.stderr, e.line
return 1
except HTTPException, e:
print >>sys.stderr, e
return 1
except URLError, e:
print >>sys.stderr, 'Failed to reach a server:\n', e.reason
return 1