[Freeipa-devel] [PATCH] 990 attribute name in exceptions
Petr Viktorin
pviktori at redhat.com
Mon Mar 19 09:11:23 UTC 2012
On 03/16/2012 10:23 PM, Rob Crittenden wrote:
> When using *attr we should return the param.name of in the exception and
> when using a cli option we should return param.cli_name. This didn't
> work consistently in the framework.
>
> This is a bit of a kludge, catching exceptions and re-raising them, but
> it is a less invasive way of doing it.
>
> I added some examples of things to test in the ticket.
>
> rob
>
> (name, error) = err.strerror.split(':')
> raise errors.ConversionError(name=attr, error=error)
AFAIU this will break when the error message is translated. Why not just
use err.kw['error']?
--
Petr³
More information about the Freeipa-devel
mailing list