##// END OF EJS Templates
Catch urllib errors for old-http in a nicer way.
Thomas Arendsen Hein -
r1821:0b3f4be5 default
parent child Browse files
Show More
@@ -15,8 +15,10 b' class rangereader(httprangereader.httpra'
15 def read(self, size=None):
15 def read(self, size=None):
16 try:
16 try:
17 return httprangereader.httprangereader.read(self, size)
17 return httprangereader.httprangereader.read(self, size)
18 except urllib2.HTTPError, inst:
19 raise IOError(None, inst)
18 except urllib2.URLError, inst:
20 except urllib2.URLError, inst:
19 raise IOError(None, str(inst))
21 raise IOError(None, inst.reason[1])
20
22
21 def opener(base):
23 def opener(base):
22 """return a function that opens files over http"""
24 """return a function that opens files over http"""
@@ -1,4 +1,4 b''
1 abort: <urlopen error (111, 'Connection refused')>
1 abort: Connection refused
2 255
2 255
3 ls: copy: No such file or directory
3 ls: copy: No such file or directory
4 changeset: 0:61c9426e69fe
4 changeset: 0:61c9426e69fe
General Comments 0
You need to be logged in to leave comments. Login now