hgweb: add catch for connection reset
authormpm@selenic.com
Sat, 27 Aug 2005 01:55:10 -0700
changeset 1087 3a1a46dcd397
parent 1086 50a8acefb53d
child 1088 39b916b1d8e4
child 1105 a906b018eaef
hgweb: add catch for connection reset suggested by Jeff Sipek
mercurial/hgweb.py
--- a/mercurial/hgweb.py	Sat Aug 27 01:50:18 2005 -0700
+++ b/mercurial/hgweb.py	Sat Aug 27 01:55:10 2005 -0700
@@ -73,7 +73,11 @@
             for part in thing:
                 write(part)
         else:
-            sys.stdout.write(str(thing))
+            try:
+                sys.stdout.write(str(thing))
+            except socket.error, x:
+                if x[0] != errno.ECONNRESET:
+                    raise
 
 class templater:
     def __init__(self, mapfile, filters={}, defaults={}):