[PATCH] Added handling for connection reset by peer exception

Jeff Sipek jeffpc at optonline.net
Wed Aug 24 22:36:33 CDT 2005


Right now it excludes only errno 104 (connection reset by peer) but it
can be easily modified to exclude any others - even all.

Jeff.

# HG changeset patch
# User Josef "Jeff" Sipek <jeffpc at optonline.net>
# Node ID 6f6173807497f86db9df290a5418a171864c8c19
# Parent  9344f5dd448843e211af39423542bc23037b6843
Added handling for "error: (104, 'Connection reset by peer')" exception

diff -r 9344f5dd4488 -r 6f6173807497 mercurial/hgweb.py
--- a/mercurial/hgweb.py	Thu Aug 25 02:19:35 2005
+++ b/mercurial/hgweb.py	Thu Aug 25 03:33:57 2005
@@ -62,7 +62,11 @@
             for part in thing:
                 write(part)
         else:
-            sys.stdout.write(str(thing))
+            try:
+                sys.stdout.write(str(thing))
+            except socket.error, x:
+	        if not x[0] == 104:
+                    raise
 
 class templater:
     def __init__(self, mapfile, filters = {}, defaults = {}):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.selenic.com/pipermail/mercurial/attachments/20050824/60a59e81/attachment.pgp


More information about the Mercurial mailing list