mercurial/commands.py
changeset 4010 e282448d68f1
parent 4009 86098ec4b77a
child 4013 54fa628b8c78
--- a/mercurial/commands.py	Tue Dec 26 21:59:01 2006 +0100
+++ b/mercurial/commands.py	Thu Dec 28 01:14:12 2006 +0100
@@ -3277,7 +3277,11 @@
         if hasattr(inst, "code"):
             u.warn(_("abort: %s\n") % inst)
         elif hasattr(inst, "reason"):
-            u.warn(_("abort: error: %s\n") % inst.reason[1])
+            try: # usually it is in the form (errno, strerror)
+                reason = inst.reason.args[1]
+            except: # it might be anything, for example a string
+                reason = inst.reason
+            u.warn(_("abort: error: %s\n") % reason)
         elif hasattr(inst, "args") and inst[0] == errno.EPIPE:
             if u.debugflag:
                 u.warn(_("broken pipe\n"))