dispatch: handle IndexErrors

This commit is contained in:
Dan Villiom Podlaski Christiansen 2011-05-01 11:01:57 +02:00
parent 720e112a65
commit 1eaa37ca32

View File

@ -133,7 +133,8 @@ def _runcatch(ui, args):
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: