[PATCH] i18n: translate abort messages

Piotr Listkiewicz piotr.listkiewicz at gmail.com
Tue Jun 14 12:52:21 EDT 2016


>
> Maybe they should be hard errors?


What do you mean by hard errors, for example they should raise something
like RuntimeError to indicate to programmer incorrect state?

2016-06-14 16:32 GMT+02:00 Yuya Nishihara <yuya at tcha.org>:

> On Tue, 14 Jun 2016 13:45:06 +0200, liscju wrote:
> > # HG changeset patch
> > # User liscju <piotr.listkiewicz at gmail.com>
> > # Date 1465898035 -7200
> > #      Tue Jun 14 11:53:55 2016 +0200
> > # Node ID 045a18140c1d065b36f1dbdea9c3cc8d62adf36d
> > # Parent  60621cecc8c53d3a27e9984fb06fefc1f99797b3
> > i18n: translate abort messages
>
> Looks like some of them aren't user-facing errors, but coding errors, such
> as
>
> > +++ b/mercurial/scmutil.py
> > @@ -461,7 +461,8 @@ class abstractvfs(object):
> >          # have a use case.
> >          vfs = getattr(self, 'vfs', self)
> >          if getattr(vfs, '_backgroundfilecloser', None):
> > -            raise error.Abort('can only have 1 active background file
> closer')
> > +            raise error.Abort(
> > +                _('can only have 1 active background file closer'))
>
> > @@ -209,7 +209,7 @@ def wrapsocket(sock, keyfile, certfile,
> >        to use.
> >      """
> >      if not serverhostname:
> > -        raise error.Abort('serverhostname argument is required')
> > +        raise error.Abort(_('serverhostname argument is required'))
>
> Maybe they should be hard errors?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160614/cc00f448/attachment.html>


More information about the Mercurial-devel mailing list