better error handling

This commit is contained in:
Yann Leboulanger 2009-11-04 22:06:45 +01:00
parent 2aef55ad2a
commit b2a4c92e7a
1 changed files with 7 additions and 2 deletions

View File

@ -58,8 +58,13 @@ def urisplit(uri):
else:
try:
port = int(port)
except:
port = 80
except ValueError:
if proto == 'https':
port = 443
else:
port = 80
log.warn('port cannot be extracted from BOSH URL %s, using port %i',
uri, port)
return proto, host, port, path
def get_proxy_data_from_dict(proxy):