diff mercurial/statichttprepo.py @ 1821:0b3f4be5c5bf

Catch urllib errors for old-http in a nicer way.
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 01 Mar 2006 15:29:13 +0100
parents 14d1f1868bf6
children 74d3f5336b66
line wrap: on
line diff
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -15,8 +15,10 @@ class rangereader(httprangereader.httpra
     def read(self, size=None):
         try:
             return httprangereader.httprangereader.read(self, size)
+        except urllib2.HTTPError, inst:
+            raise IOError(None, inst)
         except urllib2.URLError, inst:
-            raise IOError(None, str(inst))
+            raise IOError(None, inst.reason[1])
 
 def opener(base):
     """return a function that opens files over http"""