Mercurial > hg
comparison mercurial/scmutil.py @ 40658:4ec8bee15930
scmutil: display the optional hint when handling StorageError in catchall()
Other than CensoredNodeError (which is also a StorageError), it looks like all
exceptions with a hint display them. I'm not sure that it makes sense to have a
hint for censored nodes, so I'm not bothering with that.
It looks like nobody is using this yet, as the tests don't change.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 15 Nov 2018 17:50:14 -0500 |
parents | acd17caa699a |
children | 65591a513b9c |
comparison
equal
deleted
inserted
replaced
40657:2eb48aa0acce | 40658:4ec8bee15930 |
---|---|
210 ui.error("\n%r\n" % pycompat.bytestr(stringutil.ellipsis(msg))) | 210 ui.error("\n%r\n" % pycompat.bytestr(stringutil.ellipsis(msg))) |
211 except error.CensoredNodeError as inst: | 211 except error.CensoredNodeError as inst: |
212 ui.error(_("abort: file censored %s!\n") % inst) | 212 ui.error(_("abort: file censored %s!\n") % inst) |
213 except error.StorageError as inst: | 213 except error.StorageError as inst: |
214 ui.error(_("abort: %s!\n") % inst) | 214 ui.error(_("abort: %s!\n") % inst) |
215 if inst.hint: | |
216 ui.error(_("(%s)\n") % inst.hint) | |
215 except error.InterventionRequired as inst: | 217 except error.InterventionRequired as inst: |
216 ui.error("%s\n" % inst) | 218 ui.error("%s\n" % inst) |
217 if inst.hint: | 219 if inst.hint: |
218 ui.error(_("(%s)\n") % inst.hint) | 220 ui.error(_("(%s)\n") % inst.hint) |
219 return 1 | 221 return 1 |