Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 3564:eda9e7c9300d
New UnexpectedOutput exception to catch server errors in localrepo.stream_in
If the unexpected is a string, the empty string will be mentioned, and long
strings are cut to at most 400 chars.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 27 Oct 2006 18:17:12 +0200 |
parents | db946221a58a |
children | 23f7d9621783 |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Oct 27 15:56:34 2006 +0200 +++ b/mercurial/commands.py Fri Oct 27 18:17:12 2006 +0200 @@ -3522,6 +3522,15 @@ u.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename)) else: u.warn(_("abort: %s\n") % inst.strerror) + except util.UnexpectedOutput, inst: + u.warn(_("abort: %s") % inst[0]) + if not isinstance(inst[1], basestring): + u.warn(" %r\n" % (inst[1],)) + elif not inst[1]: + u.warn(_(" empty string\n")) + else: + u.warn("\n%r%s\n" % + (inst[1][:400], len(inst[1]) > 400 and '...' or '')) except util.Abort, inst: u.warn(_("abort: %s\n") % inst) except TypeError, inst: