On 09/24/2015 08:39 AM, Markus Armbruster wrote:
> Eric Blake <ebl...@redhat.com> writes:
> 
>> Use of '"...%s" % include' to print non-strings can lead to
>> ugly messages, such as this (if the .json change is applied
>> without the qapi.py change):
>>  Expected a file name (string), got: OrderedDict()
>>
>> Better is to just omit the actual non-string value in the
>> message.
>>
>> Signed-off-by: Eric Blake <ebl...@redhat.com>
>> ---

>> +                    raise QAPIExprError(expr_info,
>> +                                        "Expected a string for 'include'")

>> +++ b/tests/qapi-schema/include-non-file.json
>> @@ -1 +1 @@
>> -{ 'include': [ 'foo', 'bar' ] }
>> +{ 'include': {} }
> 
> What about "Value of 'include' must be a string'?

Sure, the bikeshed looks better in green :)

Actually, I like your wording better, so I'll go with it (not too hard,
since I already am hoisting this patch to occur before the pep8 cleanups
to reduce churn on the message, due to your feedback on 2/46).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to