changeset 14096:dea93484cf9f

dispatch: handle IndexErrors
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sun, 01 May 2011 11:01:57 +0200
parents 877390020477
children ca3376f044f8
files mercurial/dispatch.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Sat Apr 30 11:18:43 2011 -0500
+++ b/mercurial/dispatch.py	Sun May 01 11:01:57 2011 +0200
@@ -133,7 +133,8 @@
         elif hasattr(inst, "reason"):
             try: # usually it is in the form (errno, strerror)
                 reason = inst.reason.args[1]
-            except AttributeError: # it might be anything, for example a string
+            except (AttributeError, IndexError):
+                 # it might be anything, for example a string
                 reason = inst.reason
             ui.warn(_("abort: error: %s\n") % reason)
         elif hasattr(inst, "args") and inst.args[0] == errno.EPIPE: