mercurial/dispatch.py
branchstable
changeset 17299 e51d4aedace9
parent 17228 d1b49b02bc16
child 17773 434e5bd615fc
equal deleted inserted replaced
17298:59c14bf5a48c 17299:e51d4aedace9
   167             ui.warn(_("abort: %s\n") % inst)
   167             ui.warn(_("abort: %s\n") % inst)
   168         elif util.safehasattr(inst, "reason"):
   168         elif util.safehasattr(inst, "reason"):
   169             try: # usually it is in the form (errno, strerror)
   169             try: # usually it is in the form (errno, strerror)
   170                 reason = inst.reason.args[1]
   170                 reason = inst.reason.args[1]
   171             except (AttributeError, IndexError):
   171             except (AttributeError, IndexError):
   172                  # it might be anything, for example a string
   172                 # it might be anything, for example a string
   173                 reason = inst.reason
   173                 reason = inst.reason
   174             ui.warn(_("abort: error: %s\n") % reason)
   174             ui.warn(_("abort: error: %s\n") % reason)
   175         elif util.safehasattr(inst, "args") and inst.args[0] == errno.EPIPE:
   175         elif util.safehasattr(inst, "args") and inst.args[0] == errno.EPIPE:
   176             if ui.debugflag:
   176             if ui.debugflag:
   177                 ui.warn(_("broken pipe\n"))
   177                 ui.warn(_("broken pipe\n"))