mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
dispatch: handle IndexErrors
This commit is contained in:
parent
720e112a65
commit
1eaa37ca32
@ -133,7 +133,8 @@ def _runcatch(ui, args):
|
|||||||
elif hasattr(inst, "reason"):
|
elif hasattr(inst, "reason"):
|
||||||
try: # usually it is in the form (errno, strerror)
|
try: # usually it is in the form (errno, strerror)
|
||||||
reason = inst.reason.args[1]
|
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
|
reason = inst.reason
|
||||||
ui.warn(_("abort: error: %s\n") % reason)
|
ui.warn(_("abort: error: %s\n") % reason)
|
||||||
elif hasattr(inst, "args") and inst.args[0] == errno.EPIPE:
|
elif hasattr(inst, "args") and inst.args[0] == errno.EPIPE:
|
||||||
|
Loading…
Reference in New Issue
Block a user