[Freeipa-devel] [PATCH 0013] Remove user-unfriendly "u" character from error messages

Tomas Babej tbabej at redhat.com
Wed Sep 5 14:35:03 UTC 2012


On 09/05/2012 03:42 PM, Petr Viktorin wrote:
> On 09/05/2012 03:19 PM, Tomas Babej wrote:
>> Hi,
>>
>> User-unfriendly errors were caused by re-raising errors
>> from external python module netaddr.
>>
>> https://fedorahosted.org/freeipa/ticket/2588
>>
>> Tomas
>>
>>
>> _______________________________________________
>> Freeipa-devel mailing list
>> Freeipa-devel at redhat.com
>> https://www.redhat.com/mailman/listinfo/freeipa-devel
>>
>
> I don't agree with this approach. Raising another module's errors in 
> our code is ugly, and will break if netaddr changes. The arguments to 
> pass to the exceptions are undocumented (see 
> http://packages.python.org/netaddr/api.html#custom-exceptions). The 
> wording of error messages in libraries can usually change at any time, 
> and is intended for developers, not end users.
>
> This should be either fixed upstream (unlikely, using the repr() of 
> the argument is a sane thing to do at their side), or we should pass 
> bytestrings to netaddr (a possible quick fix, not sure it it'll work), 
> or, ideally, we should raise IPA's own errors.
>
Well, this particular fix wouldn't have broken anything, since it was 
raising the same error that the except clause in which the raising 
occured caught. However, I changed this to StandardError, since the 
error message is extracted and packed into ValidationError during 
further validation and therefore simple format message is suitable.

Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-tbabej-0013-2-Remove-user-unfriendly-u-character-from-error-messag.patch
Type: text/x-patch
Size: 2141 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120905/5ab10ee7/attachment.bin>


More information about the Freeipa-devel mailing list